wynn/.gitea/workflows/dockerfiles.yml

47 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2025-02-27 04:36:09 +00:00
name: commit-tag
on:
push
jobs:
commit-tag-image:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
env:
DOCKER_LATEST: nightly
RUNNER_TOOL_CACHE: /toolcache
2025-02-27 05:33:28 +00:00
REGISTRY: tuxpa.in
IMAGE_ROOT: a/wynn
2025-03-02 23:55:01 +00:00
strategy:
matrix:
2025-03-03 00:18:02 +00:00
args:
- name: ts
context: ./ts
file: ./ts/Dockerfile
- name: "migrations"
context: ./migrations
file: ./migrations/Dockerfile
2025-02-27 04:36:09 +00:00
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: https://tuxpa.in
username: actions_token
password: ${{ secrets.ACTIONS_TOKEN }}
2025-03-03 00:34:53 +00:00
- name: build and push docker images
2025-02-27 04:36:09 +00:00
uses: docker/build-push-action@v6
with:
2025-03-03 00:18:02 +00:00
context: ${{ matrix.args.context }}
file: ${{ matrix.args.file }}
2025-03-02 08:38:31 +00:00
platforms: linux/amd64
2025-02-27 04:36:09 +00:00
push: true
2025-03-03 00:18:02 +00:00
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_ROOT }}/${{matrix.args.name}}:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_ROOT }}/${{matrix.args.name}}:cache,mode=max,image-manifest=true,oci-mediatypes=true,type=registry
2025-02-27 05:02:58 +00:00
tags: |
2025-03-03 00:18:02 +00:00
${{env.REGISTRY}}/${{env.IMAGE_ROOT}}/${{matrix.args.name}}:${{ gitea.ref_name }},
${{env.REGISTRY}}/${{env.IMAGE_ROOT}}/${{matrix.args.name}}:${{ gitea.head_ref || gitea.ref_name }}
2025-02-27 04:36:09 +00:00