Files
simple-web-service/.gitea/workflows/ci.yaml
cdryzun 5c04753ab5
Some checks failed
ci / build (amd64) (push) Failing after 4s
feat: add gitea app
2023-08-24 18:39:55 +08:00

49 lines
1.9 KiB
YAML

name: ci
on:
push:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
strategy:
matrix:
arch:
- amd64
steps:
- name: Download CLI
run: |
# Download walrus cli
curl -v -k -o walrus -LO "${{ secrets.CI_WALRUS_SERVER }}/cli?arch=amd64&os=linux"
chmod +x ./walrus
- name: Deploy
run: |
# # Set Run envlist
# export ATTRIBUTES=
# Setup CLI config
./walrus config setup \
--server ${{ secrets.CI_WALRUS_SERVER }} \
--project web \
--environment dev \
--token '${{ secrets.CI_WALRUS_TOKEN }}
./walrus service upgrade gitea-simple-web-service \
--template '{"name":"deploy-source-code", "version":"v0.0.1"}' \
--attributes '{ "git_url": "https://git.treesir.pub/demoTest/simple-web-service", "git_branch": "main", "git_auth": false, "registry_auth": true, "registry_username": "yangzun", "registry_password": "${{ secrets.CI_REGISTRY_PASSWORD }}", "image": "yangzun/simple-web-service:${{ github.sha }}", "namespace": "default", "name": "simple-web-service", "ports": [8080] }'
# Build and deploy from source code
./walrus service create \
--name gitea-simple-web-service \
--template '{"name":"deploy-source-code", "version":"v0.0.1"}' \
--attributes '{ "git_url": "https://git.treesir.pub/demoTest/simple-web-service", "git_branch": "main", "git_auth": false, "registry_auth": true, "registry_username": "yangzun", "registry_password": "${{ secrets.CI_REGISTRY_PASSWORD }}", "image": "yangzun/simple-web-service:${{ github.sha }}", "namespace": "default", "name": "simple-web-service", "ports": [8080] }' \
-d