This commit is contained in:
parent
aed74d15d9
commit
4c117d51c7
62
.github/workflows/build-docker.yml
vendored
Normal file
62
.github/workflows/build-docker.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
- feature-42
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
registry: gitea.cuqmbr.xyz
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{env.registry}}
|
||||||
|
username: ${{vars.DOCKER_USER}}
|
||||||
|
password: ${{secrets.DOCKER_TOKEN}}
|
||||||
|
# Using instead of checkout action.
|
||||||
|
# https://gitea.com/gitea/act_runner/issues/164#issuecomment-921571
|
||||||
|
- name: Add SSH key
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
|
run: |
|
||||||
|
mkdir -p /home/runner/.ssh
|
||||||
|
ssh-keyscan gitea.cuqmbr.xyz >> /home/runner/.ssh/known_hosts
|
||||||
|
echo "${{secrets.SSH_PULL_KEY}}" > /home/runner/.ssh/github_actions
|
||||||
|
chmod 600 /home/runner/.ssh/github_actions
|
||||||
|
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
|
||||||
|
ssh-add /home/runner/.ssh/github_actions
|
||||||
|
- name: Checkout repository
|
||||||
|
env:
|
||||||
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
|
run: |
|
||||||
|
git init
|
||||||
|
git remote add origin git@gitea.cuqmbr.xyz:bebrashield/server-survival.git
|
||||||
|
git fetch --depth 1 origin ${{ github.ref }}
|
||||||
|
git checkout FETCH_HEAD
|
||||||
|
git lfs pull
|
||||||
|
# - name: Checkout repository
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# with:
|
||||||
|
# token: ${{secrets.PULL_TOKEN}}
|
||||||
|
# lfs: true
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/arm64,linux/amd64
|
||||||
|
push: true
|
||||||
|
# TODO: split tag names into multiple lines
|
||||||
|
tags: |
|
||||||
|
${{env.registry}}/${{github.repository_owner}}/${{github.event.repository.name}}/${{github.ref_name}}:${{github.sha}}
|
||||||
|
${{env.registry}}/${{github.repository_owner}}/${{github.event.repository.name}}/${{github.ref_name}}:latest
|
Loading…
Reference in New Issue
Block a user