Skip to content

RDKE-61: Use common GH context variables (#4) (#5) #2

RDKE-61: Use common GH context variables (#4) (#5)

RDKE-61: Use common GH context variables (#4) (#5) #2

name: Build and Push amd64 Docker Image to GHCR
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-push:
runs-on: ubuntu-latest
if : ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PACAKGE_UPDATE_KEY }}
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest