All checks were successful
Docker CI / release (push) Successful in 2m50s
68 lines
1.7 KiB
YAML
68 lines
1.7 KiB
YAML
name: Docker CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
node-version: 20.x
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: |
|
|
code.nzambello.dev/nzambello/nzambello.dev
|
|
labels: |
|
|
org.label-schema.docker.cmd=docker run -d -p 8080:8080 code.nzambello.dev/nzambello/nzambello.dev:latest
|
|
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: code.nzambello.dev
|
|
username: nzambello
|
|
password: ${{ secrets.ACTIONS_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
platforms: linux/amd64,linux/arm64
|
|
file: Dockerfile
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: |
|
|
code.nzambello.dev/nzambello/nzambello.dev:latest
|
|
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: code.nzambello.dev/nzambello/nzambello.dev
|