create workflow to build image on release
Build and Push Docker Image / build (release) Failing after 1m1s
Build and Push Docker Image / build (release) Failing after 1m1s
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.innovativename.xyz
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.ref }}
|
||||||
|
SHORT_HASH: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
# Build the image with the commit hash tag
|
||||||
|
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t gitea.innovativename.xyz/Cleo/archipelago-server-docker:${RELEASE_TAG} .
|
||||||
|
|
||||||
|
# Tag the same image as "latest"
|
||||||
|
docker tag gitea.innovativename.xyz/Cleo/archipelago-server-docker:${RELEASE_TAG} gitea.innovativename.xyz/Cleo/archipelago-server-docker:latest
|
||||||
|
|
||||||
|
- name: Push Docker Images
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.ref }}
|
||||||
|
SHORT_HASH: ${{ github.sha }}
|
||||||
|
run: |
|
||||||
|
docker push gitea.innovativename.xyz/Cleo/archipelago-server-docker:${RELEASE_TAG}
|
||||||
|
docker push gitea.innovativename.xyz/Cleo/archipelago-server-docker:latest
|
||||||
|
|
||||||
|
- name: Log out from registry
|
||||||
|
if: always()
|
||||||
|
run: docker logout gitea.innovativename.xyz
|
||||||
Reference in New Issue
Block a user