Merge pull request #23 from hunter-io/3.4.3 #60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create and publish the Ruby base image | |
| on: push | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Authenticate with Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v2 | |
| - name: Configure Docker to use Google Artifact Registry | |
| run: gcloud auth configure-docker europe-west1-docker.pkg.dev | |
| - name: Extract branch name | |
| id: extract_branch_name | |
| shell: bash | |
| run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
| - if: github.ref != 'refs/heads/main' | |
| name: Build and push tagged version | |
| uses: docker/build-push-action@v2 | |
| with: | |
| push: true | |
| tags: europe-west1-docker.pkg.dev/hunter-io/hunter/baseimage-ruby:${{ steps.extract_branch_name.outputs.branch }} | |
| - if: github.ref == 'refs/heads/main' | |
| name: Build and push latest | |
| uses: docker/build-push-action@v2 | |
| with: | |
| push: true | |
| tags: europe-west1-docker.pkg.dev/hunter-io/hunter/baseimage-ruby:latest |