fix
This commit is contained in:
@@ -5,37 +5,40 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: git.alexav.gg/${{ gitea.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.RUNNER_TOKEN }}" \
|
||||||
|
| docker login git.alexav.gg -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
|
||||||
# The Dockerfile has two runnable stages and no sensible default: an
|
# The Dockerfile has two runnable stages and no sensible default: an
|
||||||
# untargeted build produces the last one (frontend) on its own, which
|
# untargeted build produces the last one (frontend) on its own, which
|
||||||
# then has nothing to proxy /api to. Both get published separately.
|
# then has nothing to proxy /api to. Both get published separately.
|
||||||
- name: Build Docker Images
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
docker build --target backend \
|
for target in backend frontend; do
|
||||||
-t git.alexav.gg/${{ gitea.repository }}:backend-latest \
|
docker build --target "$target" \
|
||||||
-t git.alexav.gg/${{ gitea.repository }}:backend-${{ gitea.sha }} .
|
-t "$IMAGE:$target-latest" \
|
||||||
docker build --target frontend \
|
-t "$IMAGE:$target-$GITEA_SHA" .
|
||||||
-t git.alexav.gg/${{ gitea.repository }}:frontend-latest \
|
docker push "$IMAGE:$target-latest"
|
||||||
-t git.alexav.gg/${{ gitea.repository }}:frontend-${{ gitea.sha }} .
|
docker push "$IMAGE:$target-$GITEA_SHA"
|
||||||
|
done
|
||||||
- name: Login to Gitea Registry
|
env:
|
||||||
run: |
|
GITEA_SHA: ${{ gitea.sha }}
|
||||||
echo "${{ secrets.RUNNER_TOKEN }}" | docker login git.alexav.gg -u ${{ gitea.actor }} --password-stdin
|
|
||||||
|
|
||||||
- name: Push Docker Images
|
|
||||||
run: |
|
|
||||||
docker push git.alexav.gg/${{ gitea.repository }}:backend-latest
|
|
||||||
docker push git.alexav.gg/${{ gitea.repository }}:backend-${{ gitea.sha }}
|
|
||||||
docker push git.alexav.gg/${{ gitea.repository }}:frontend-latest
|
|
||||||
docker push git.alexav.gg/${{ gitea.repository }}:frontend-${{ gitea.sha }}
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy
|
- uses: https://git.alexav.gg/alex/deploy-action@v1
|
||||||
uses: alex/blog/.github/workflows/deploy.yml
|
with:
|
||||||
|
token: ${{ secrets.RUNNER_TOKEN }}
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
name: Deploy action
|
name: Deploy blog
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
RUNNER_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
run:
|
jobs:
|
||||||
- uses: https://git.alexav.gg/alex/deploy-action@v1
|
deploy:
|
||||||
with:
|
runs-on: ubuntu-latest
|
||||||
task: blog_deploy
|
steps:
|
||||||
token: ${{ secrets.RUNNER_TOKEN }}
|
- uses: https://git.alexav.gg/alex/deploy-action@v1
|
||||||
|
with:
|
||||||
|
task: blog_deploy
|
||||||
|
token: ${{ secrets.RUNNER_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user