test5
All checks were successful
/ release (push) Successful in 1m53s

This commit is contained in:
Luke Tainton 2025-01-02 16:21:13 +00:00
parent 8a64585b49
commit 53eaecff38
Signed by: luke
SSH Key Fingerprint: SHA256:D34npKT7UaiT/7gULqu7EPSLWWVAjTjXf4kKfJ/fQBo

View File

@ -1,5 +1,3 @@
name: Publish Docker Image
on: on:
push: push:
branches: branches:
@ -8,11 +6,8 @@ on:
- cron: '@weekly' - cron: '@weekly'
jobs: jobs:
publish: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps: steps:
- name: Update Docker configuration - name: Update Docker configuration
continue-on-error: true continue-on-error: true
@ -23,7 +18,6 @@ jobs:
touch -a /etc/docker/daemon.json touch -a /etc/docker/daemon.json
echo "DOCKER_OPTS=\"--insecure-registry ${{ vars.PACKAGES_REGISTRY_URL }}\"" >> /etc/default/docker echo "DOCKER_OPTS=\"--insecure-registry ${{ vars.PACKAGES_REGISTRY_URL }}\"" >> /etc/default/docker
echo "{\"insecure-registries\": [\"${{ vars.PACKAGES_REGISTRY_URL }}\"]}" > /etc/docker/daemon.json echo "{\"insecure-registries\": [\"${{ vars.PACKAGES_REGISTRY_URL }}\"]}" > /etc/docker/daemon.json
systemctl restart docker
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4.2.2 uses: actions/checkout@v4.2.2
@ -31,20 +25,25 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Package Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.PACKAGES_REGISTRY_URL }}
username: ${{ vars.PACKAGES_REGISTRY_USERNAME }}
password: ${{ secrets.PACKAGES_REGISTRY_PASSWORD }}
# - name: Log in to Gitea Package Registry # - name: Log in to Gitea Package Registry
# run: echo ${{ secrets.PACKAGES_REGISTRY_PASSWORD }} | docker login ${{ vars.PACKAGES_REGISTRY_URL }} -u ${{ vars.PACKAGES_REGISTRY_USERNAME }} --password-stdin # uses: docker/login-action@v3
# with:
# registry: ${{ vars.PACKAGES_REGISTRY_URL }}
# username: ${{ vars.PACKAGES_REGISTRY_USERNAME }}
# password: ${{ secrets.PACKAGES_REGISTRY_PASSWORD }}
- name: Build and push Docker image - name: Log in to Gitea Package Registry
id: push run: echo ${{ secrets.PACKAGES_REGISTRY_PASSWORD }} | docker login ${{ vars.PACKAGES_REGISTRY_URL }} -u ${{ vars.PACKAGES_REGISTRY_USERNAME }} --password-stdin
uses: docker/build-push-action@v6
with: # - name: Build and push Docker image
context: . # uses: docker/build-push-action@v6
push: true # with:
tags: ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest # context: .
# push: true
# tags: ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest
- name: Build image
run: docker build -t ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest .
- name: Push image
run: docker push ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest