name: Build Image and Deploy to GHCR on: workflow_dispatch: release: types: [created] jobs: build-docker-image: runs-on: ubuntu-latest steps: - name: Checkout GitHub Action uses: actions/checkout@main - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.PAT }} - name: Get Version id: get_version run: | RAW_VERSION="${{ github.event.release.tag_name }}" VERSION="${RAW_VERSION#v}" echo "VERSION=${VERSION}" >> $GITHUB_ENV echo "Version = ${VERSION}" - name: Build and Push Docker Image run: | VERSION="${{ github.event.release.tag_name }}" docker buildx build \ --platform linux/amd64,linux/arm64 \ --tag ghcr.io/mattblackonly/spotspot:latest \ --tag ghcr.io/mattblackonly/spotspot:${{ env.VERSION }} \ --build-arg SPOTSPOT_VERSION=${VERSION} \ --push .