1
0
Fork 0
This repository has been archived on 2023-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
docker-minecraft-mcu/.gitea/workflows/build.yaml

93 lines
3.8 KiB
YAML

name: Build Container Image
run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }}
on: [push, workflow_call]
jobs:
build_amd64:
if: gitea.repository_owner == 'NephNET' && !contains(github.event.head_commit.message, '#noci')
runs-on: nephnet-amd64
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Docker Build
run: |
docker build --pull -t code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-cached --target builder ${{ gitea.workspace }}
docker build --pull -t code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64 ${{ gitea.workspace }}
- name: Docker Login
uses: actions/docker-login@v2
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Push
run: docker push code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64
- name: Notify Discord
uses: actions/discord-status@v1
if: always()
with:
title: "Container Build (X86_64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_manifest:
needs: [build_amd64]
runs-on: nephnet
steps:
- name: Docker Login
uses: actions/docker-login@v2
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }} --amend code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}-amd64
docker manifest push --purge code.nephatrine.net/nephnet/minecraft-mcu:${{ gitea.ref_name }}
publish_amd64:
if: gitea.ref_name == 'master'
needs: [build_amd64]
runs-on: nephnet-amd64
steps:
- name: Check Base Image
if: github.event_name != 'push'
uses: actions/docker-base-image-check@v1.2.1
id: checkbase
with:
base-image: nephatrine/alpine-s6:latest-amd64
image: nephatrine/minecraft-mcu:latest-amd64
- name: Docker Login
uses: actions/docker-login@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Push
run: |
docker tag code.nephatrine.net/nephnet/minecraft-mcu:master-amd64 nephatrine/minecraft-mcu:latest-amd64
docker push nephatrine/minecraft-mcu:latest-amd64
- name: Notify Discord
if: github.event_name == 'push' || steps.checkbase.outputs.needs-updating == 'true'
uses: actions/discord-status@v1
with:
title: "DockerHub: drone-ci"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/minecraft-mcu/general).\nPull `nephatrine/minecraft-mcu:latest-amd64` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
publish_manifest:
needs: [publish_amd64]
runs-on: nephnet
steps:
- name: Docker Login
uses: actions/docker-login@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: |
docker manifest create nephatrine/minecraft-mcu:latest --amend nephatrine/minecraft-mcu:latest-amd64
docker manifest push --purge nephatrine/minecraft-mcu:latest
- name: Checkout Repository
uses: actions/checkout@v3
- name: Docker Describe
uses: actions/dockerhub-update-description@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: nephatrine/minecraft-mcu