writefreely-docker/.github/workflows/docker-publish.yml

59 lines
1.3 KiB
YAML
Raw Normal View History

2022-05-10 20:41:03 +03:00
name: Docker
on:
2024-05-19 15:50:15 +03:00
workflow_dispatch:
2022-05-10 20:41:03 +03:00
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
2024-05-19 15:50:15 +03:00
schedule:
- cron: '37 1 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
2022-05-10 20:41:03 +03:00
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
2024-05-19 15:50:15 +03:00
- name: Checkout code
uses: actions/checkout@v4
2022-05-10 20:41:03 +03:00
- name: Log in to Docker Hub
2024-05-19 15:50:15 +03:00
uses: docker/login-action@v3
2022-05-10 20:41:03 +03:00
with:
2024-05-19 15:50:15 +03:00
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2022-05-10 20:41:03 +03:00
2024-05-19 15:50:15 +03:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get metadata
2022-05-10 20:41:03 +03:00
id: meta
2024-05-19 15:50:15 +03:00
uses: docker/metadata-action@v5
2022-05-10 20:41:03 +03:00
with:
images: |
jrasanen/writefreely
ghcr.io/${{ github.repository }}
2024-05-19 15:50:15 +03:00
- name: Build and Push
uses: docker/build-push-action@v5
2022-05-10 20:41:03 +03:00
with:
context: .
2024-05-19 15:50:15 +03:00
file: ./Dockerfile
2022-05-10 20:41:03 +03:00
push: true
labels: ${{ steps.meta.outputs.labels }}
2024-05-19 15:50:15 +03:00
tags: |
${{ steps.meta.outputs.tags }}
${{ env.DOCKERHUB_REPO }}:latest
platforms: linux/amd64,linux/arm64