update: new version #8
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 Docker images | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/docker.yml" | |
- "*Dockerfile" | |
- "src/resumake/**" | |
# Allows running this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
push_to_registry: | |
name: Push Docker images to Docker Hub | |
if: github.repository == 'cybardev/resume' | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker [env img] | |
id: meta-env | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
cybardev/resumake-env | |
ghcr.io/cybardev/resumake-env | |
- name: Build and push Docker environment image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ steps.meta-env.outputs.tags }} | |
labels: ${{ steps.meta-env.outputs.labels }} | |
- name: Extract metadata (tags, labels) for Docker [app img] | |
id: meta-app | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
cybardev/resumake | |
ghcr.io/cybardev/resumake | |
- name: Build and push Docker application image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./resumake.Dockerfile | |
push: true | |
tags: ${{ steps.meta-app.outputs.tags }} | |
labels: ${{ steps.meta-app.outputs.labels }} |