Skip to content
Snippets Groups Projects
Commit 9187d0e0 authored by Griefed's avatar Griefed :joystick:
Browse files

ci: Implement changes learned from ServerPackCreator CI/CD-Pipeline

parent 719fc9df
No related branches found
No related tags found
No related merge requests found
name: ci-publish-ijo42
on:
push:
branches:
- ijo42
jobs:
multi-registries:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/ijo42'
steps:
-
name: Checkout
uses: actions/checkout@v2.3.4
with:
ref: ijo42
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:ijo42-latest
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:ijo42-latest
\ No newline at end of file
name: ci-publish-latest
on:
push:
branches:
- main
jobs:
multi-registries:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
\ No newline at end of file
name: ci-publish-tag
on:
push:
tags:
- '*.*'
workflow_dispatch:
jobs:
multi-registries:
runs-on: ubuntu-latest
steps:
-
name: Checkout
# SETUP ENVIRONMENT
- name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
-
name: Login to DockerHub
# GENERATE CHANGELOG, TAG, RELEASE
- id: conventional_changelog
uses: ardalanamini/auto-changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- id: compute_tag
uses: craig-day/compute-tag@v11
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version_scheme: semantic
version_type: patch
# MAJOR.MINOR.PATCH
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.compute_tag.outputs.next_tag }}
release_name: "Curseforge-Bot"
body: |
Automatic release of version: **${{ steps.compute_tag.outputs.next_tag }}**
**Changes in this release:**
${{ steps.conventional_changelog.outputs.changelog }}
draft: false
prerelease: false
# DOCKER RELATED
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
......@@ -46,5 +62,5 @@ jobs:
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{steps.vars.outputs.tag}}
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{steps.vars.outputs.tag}}
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.compute_tag.outputs.next_tag }}
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.compute_tag.outputs.next_tag }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment