Merge pull request #13 from hunter-io/3.3.0 #39
This file contains 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@v2 | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- 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: ghcr.io/hunter-io/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: ghcr.io/hunter-io/baseimage-ruby:latest |