v24.4.12 #10
Workflow file for this run
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: Publish Image | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
env: | |
image: ghcr.io/nilashishc/ansible-creator-service | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build the container image for ansible-creator-service and publish it | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
docker build -f Containerfile -t ${{ env.image }}:latest . | |
- name: Build the container image for ansible-creator-service and publish it (when tagged) | |
if: github.event_name == 'release' | |
run: | | |
docker build -f Containerfile -t ${{ env.image }}:latest -t ${{ env.image }}:${{ github.ref_name }} . | |
- name: Push image with all tags | |
run: | | |
docker push ${{ env.image }} --all-tags |