49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Publish Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: '@weekly'
|
|
|
|
env:
|
|
DOCKER_OPTS: '--insecure-registry 15.206.81.210:9000'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- run: cat /etc/default/docker
|
|
|
|
# - 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
|
|
run: echo ${{ secrets.PACKAGES_REGISTRY_PASSWORD }} | docker login ${{ vars.PACKAGES_REGISTRY_URL }} -u ${{ vars.PACKAGES_REGISTRY_USERNAME }} --password-stdin
|
|
with:
|
|
registry: ${{ vars.PACKAGES_REGISTRY_URL }}
|
|
username: ${{ vars.PACKAGES_REGISTRY_USERNAME }}
|
|
password: ${{ secrets.PACKAGES_REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push Docker image
|
|
id: push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ env.REGISTRY_URL }}/${{ gitea.repository }}:latest
|