nzambello.dev/.forgejo/workflows/publish.yml

68 lines
1.7 KiB
YAML
Raw Normal View History

2023-07-18 19:08:26 +02:00
name: Docker CI
on:
push:
branches:
- main
workflow_dispatch:
env:
node-version: 20.x
2023-07-18 19:08:26 +02:00
jobs:
release:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
2023-07-18 19:08:26 +02:00
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
git.nzambello.dev/nzambello/nzambello.dev
2023-07-18 19:08:26 +02:00
labels: |
org.label-schema.docker.cmd=docker run -d -p 8080:8080 git.nzambello.dev/nzambello/nzambello.dev:latest
2023-07-18 19:08:26 +02:00
flavor: latest=false
tags: |
type=ref,event=branch
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: git.nzambello.dev
username: nzambello
password: ${{ secrets.ACTIONS_TOKEN }}
2023-07-18 19:08:26 +02:00
- name: Build and push
uses: docker/build-push-action@v3
with:
2023-07-18 19:12:44 +02:00
platforms: linux/amd64,linux/arm64
file: Dockerfile
2023-07-18 19:08:26 +02:00
push: ${{ github.event_name != 'pull_request' }}
tags: |
2024-05-21 20:25:28 +02:00
git.nzambello.dev/nzambello/nzambello.dev:latest
2023-07-18 19:08:26 +02:00
labels: $${{ steps.meta.outputs.labels }}
- name: Deploy
uses: darnfish/watchtower-update@v3.2
with:
url: https://watchtower.nzambello.dev/v1/update
api_token: '${{ secrets.WATCHTOWER_API_TOKEN }}'
images: git.nzambello.dev/nzambello/nzambello.dev