mirror of
https://github.com/JuLi0n21/homepage.git
synced 2026-04-19 23:30:06 +00:00
Modify Docker build workflow for private registry
Updated the workflow to include login to a private Docker registry and changed the image tags for pushing.
This commit is contained in:
25
.github/workflows/docker-build.yml
vendored
25
.github/workflows/docker-build.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Build Astro Image
|
name: Build and Push Astro Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -19,19 +19,18 @@ jobs:
|
|||||||
id: vars
|
id: vars
|
||||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Build and Export to Docker
|
- name: Login to Private Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: docker-ui.illegalesachen.download
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
load: false
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
astro:latest
|
docker-ui.illegalesachen.download/repository/astro-homepage:latest
|
||||||
astro:${{ steps.vars.outputs.sha_short }}
|
docker-ui.illegalesachen.download/repository/astro-homepage:${{ steps.vars.outputs.sha_short }}
|
||||||
outputs: type=docker,dest=/tmp/astro-image.tar
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: astro-docker-${{ steps.vars.outputs.sha_short }}
|
|
||||||
path: /tmp/astro-image.tar
|
|
||||||
retention-days: 7
|
|
||||||
|
|||||||
Reference in New Issue
Block a user