woodburn-bot/.gitea/workflows/build.yml
Nathan Woodburn 2bc9d05ae5
Some checks failed
Build Docker / Build Docker (push) Successful in 19s
Build Docker / Build Docker v2 (push) Failing after 6s
actions: Test custom 3
2023-08-12 14:24:36 +10:00

55 lines
2.3 KiB
YAML

name: Build Docker
run-name: Build Docker Image
on: [push]
jobs:
Build Docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Docker
run : |
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce-cli -y
- name: Build Docker image
run : |
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
tag_num=$(git rev-parse --short HEAD)
docker build -t woodburn-bot:$tag_num .
docker tag woodburn-bot:$tag_num git.woodburn.au/nathanwoodburn/woodburn-bot:$tag_num
docker push git.woodburn.au/nathanwoodburn/woodburn-bot:$tag_num
docker tag woodburn-bot:$tag_num git.woodburn.au/nathanwoodburn/woodburn-bot:latest
docker push git.woodburn.au/nathanwoodburn/woodburn-bot:latest
Build Docker v2:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to private registry
uses: docker/login-action@v1
with:
registry: https://git.woodburn.au
username: nathanwoodburn
password: ${{ secrets.DOCKERGIT_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: 'https://git.woodburn.au/nathanwoodburn/server:latest'
cache-from: 'type=registry,ref=https://git.woodburn.au/nathanwoodburn/server:buildcache'
cache-to: 'type=registry,ref=https://git.woodburn.au/nathanwoodburn/server:buildcache,mode=max'