Merge pull request #3044 from pbek/dependabot/github_actions/docker/b… #42
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
# Test image with: | |
# docker run -i -t ghcr.io/pbek/qownnotes-ubuntu22-dev:latest /bin/bash | |
name: 📦 Create and publish release Docker image | |
on: | |
workflow_dispatch: | |
schedule: | |
# build every month | |
- cron: "0 0 1 * *" | |
push: | |
branches: | |
- main | |
tags-ignore: | |
- '*' | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-paths | |
paths: | |
- '.github/workflows/build-deploy-release-image.yml' | |
- 'build-systems/github/ubuntu22-dev/Dockerfile' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: pbek/qownnotes-ubuntu22-dev | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: build-systems/github/ubuntu22-dev | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |