Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb2b31bb61 | ||
|
|
cdbf448291 |
44
.gitea/workflows/build_container.yml
Normal file
44
.gitea/workflows/build_container.yml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*' # Trigger on any git tag
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: docker:rc-dind
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install dedps
|
||||||
|
run: |
|
||||||
|
apk add --no-cache nodejs npm git
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build container image
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: papryk/dj-spangebob
|
||||||
|
TAG: ${{ gitea.ref_name }}
|
||||||
|
run: |
|
||||||
|
docker build -t "$IMAGE_NAME:$TAG" .
|
||||||
|
|
||||||
|
- name: Log in to Docker registry
|
||||||
|
env:
|
||||||
|
REGISTRY: https://gitea.papryk.com
|
||||||
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
echo "$REGISTRY_PASSWORD" | docker "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
env:
|
||||||
|
REGISTRY: https://gitea.papryk.com
|
||||||
|
IMAGE_NAME: Papryk/dj-spangebob
|
||||||
|
TAG: ${{ gitea.ref_name }}
|
||||||
|
run: |
|
||||||
|
docker push "$REGISTRY/$IMAGE_NAME:$TAG"
|
||||||
|
|
||||||
Reference in New Issue
Block a user