This commit is contained in:
parent
fdd1c07cab
commit
33bac607a4
1 changed files with 25 additions and 19 deletions
|
|
@ -4,32 +4,38 @@ run-name: Build and Push Docker Image
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 20 * * 5'
|
- cron: '0 20 * * 5'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
|
# The runner with this label must have Docker installed to be able to run service containers.
|
||||||
runs-on: node
|
runs-on: node
|
||||||
|
services:
|
||||||
|
dind:
|
||||||
|
image: docker:24-dind
|
||||||
|
options: --privileged
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Builder
|
||||||
uses: docker/setup-buildx-action@v3
|
# This action will automatically use the 'dind' service as the build server.
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Forgejo Registry
|
- name: Login to Forgejo Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.CI_REGISTRY }}
|
registry: ${{ secrets.CI_REGISTRY }}
|
||||||
username: ${{ secrets.CI_REGISTRY_USER }}
|
username: ${{ secrets.CI_REGISTRY_USER }}
|
||||||
password: ${{ secrets.CI_TOKEN }}
|
password: ${{ secrets.CI_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}:latest
|
tags: ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}:latest
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue