diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 011831a..683b462 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -3,8 +3,6 @@ name: Image Build and Push on: push: branches: [main] - release: - types: [published] jobs: build-and-push-image: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..723974f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +--- +name: Release Build and Publish +on: + release: + types: [published] + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get release version + id: get_version + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Image + uses: docker/build-push-action@v4 + with: + push: true + tags: | + ghcr.io/routedbits/pingfinder:${{ env.RELEASE_VERSION }}