From d0ae6d1042f37bf84b6370b4676e55532bf17d15 Mon Sep 17 00:00:00 2001 From: cdryzun Date: Wed, 23 Aug 2023 19:35:29 +0800 Subject: [PATCH] feat: add walrus ci workflow --- .gitea/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..7d6377a --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,30 @@ +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: | + # Setup CLI config + ./walrus config setup --server ${{ secrets.CI_WALRUS_SERVER }} --project web --environment dev --token ${{ secrets.CI_WALRUS_TOKEN }} + + # Build and deploy from source code + ./walrus service create --name 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"}' -d \ No newline at end of file