ci: add gitea actions deploy workflow
Some checks failed
Build and deploy / build-deploy (push) Failing after 6s
Some checks failed
Build and deploy / build-deploy (push) Failing after 6s
This commit is contained in:
38
.gitea/workflows/deploy.yml
Normal file
38
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Build and deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
IMAGE: gitea.mystmec.com/ola/boka-gasol247
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login gitea.mystmec.com \
|
||||
-u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build \
|
||||
-t "$IMAGE:latest" \
|
||||
-t "$IMAGE:${{ github.sha }}" \
|
||||
.
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push "$IMAGE:latest"
|
||||
docker push "$IMAGE:${{ github.sha }}"
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
cd /host-stacks/gas-mystmec
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
Reference in New Issue
Block a user