michals-silly-game-frontend/.forgejo/workflows/deploy.yaml

56 lines
1.8 KiB
YAML
Raw Normal View History

2025-04-08 08:23:02 +00:00
name: ci
2025-04-08 08:10:23 +00:00
on: push
2025-04-07 10:58:47 +00:00
jobs:
2025-04-08 08:23:02 +00:00
build:
runs-on: ubuntu-22.04
2025-04-07 10:58:47 +00:00
steps:
2025-04-08 09:13:12 +00:00
- name: Repository meta
2025-04-08 08:16:17 +00:00
id: repository
run: |
registry=${{ github.server_url }}
registry=${registry##http*://}
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
echo "registry=${registry}"
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
echo "repository=${repository}"
2025-04-08 09:13:12 +00:00
- name: Docker meta
2025-04-08 08:16:17 +00:00
uses: docker/metadata-action@v5
id: docker
with:
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
2025-04-08 09:13:12 +00:00
- name: Login to registry
2025-04-07 10:58:47 +00:00
uses: docker/login-action@v3
with:
2025-04-08 08:16:17 +00:00
registry: ${{ steps.repository.outputs.registry }}
username: ${{ secrets.PACKAGES_USER }}
password: ${{ secrets.PACKAGES_TOKEN }}
2025-04-08 09:13:12 +00:00
- name: Set up QEMU
2025-04-08 08:23:02 +00:00
uses: docker/setup-qemu-action@v3
2025-04-08 09:13:12 +00:00
- name: Set up Docker Buildx
2025-04-08 08:23:02 +00:00
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: '--allow-insecure-entitlement network.host'
driver-opts: network=host
2025-04-08 10:26:56 +00:00
- name: Lint & Test
2025-04-08 09:13:12 +00:00
run: |
2025-04-08 09:36:52 +00:00
registry=${{ github.server_url }}
registry=${registry##http*://}
2025-04-08 09:40:02 +00:00
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
2025-04-08 09:51:43 +00:00
fullrepo=https://${registry}/${repository}.git
git init
2025-04-08 09:46:06 +00:00
git pull ${fullrepo}
2025-04-08 10:25:07 +00:00
npm install @angular/cli
2025-04-08 10:26:56 +00:00
npm run lint
npm run test
2025-04-08 09:05:09 +00:00
- name: Build and push
2025-04-08 08:23:02 +00:00
uses: docker/build-push-action@v6
2025-04-07 10:58:47 +00:00
with:
push: true
2025-04-08 08:23:02 +00:00
allow: network.host
network: host
platforms: linux/arm64
2025-04-08 08:16:17 +00:00
tags: ${{ steps.docker.outputs.tags }}