From fd276bdb94c5f64fcc67034014e0cbf08fdb48be Mon Sep 17 00:00:00 2001 From: Xeovalyte Date: Fri, 12 May 2023 14:36:29 +0200 Subject: [PATCH] added ci workflow --- .gitea/workflows/ci.yml | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..51cb0d3 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,63 @@ +name: Build and Deploy +on: [push] + +jobs: + Deploy Web: + runs-on: ubuntu-latest + + container: + image: catthehacker/ubuntu:act-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Nodejs + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install + working-directory: ./web + - run: npm run build + working-directory: ./web + + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + + - uses: docker/login-action@v2 + with: + registry: gitea.xeovalyte.dev + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - run: docker buildx build -t gitea.xeovalyte.dev/xeovalyte/polarcraft-web:latest --load --platform=linux/amd64 . + working-directory: ./web + - run: docker push gitea.xeovalyte.dev/xeovalyte/polarcraft-web:latest + working-directory: ./web + + Deploy Discord Bot: + runs-on: ubuntu-latest + + container: + image: catthehacker/ubuntu:act-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Nodejs + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install + working-directory: ./discord-bot + + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + + - uses: docker/login-action@v2 + with: + registry: gitea.xeovalyte.dev + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - run: docker buildx build -t gitea.xeovalyte.dev/xeovalyte/polarcraft-web:latest --load --platform=linux/amd64 . + working-directory: ./discord-bot + - run: docker push gitea.xeovalyte.dev/xeovalyte/polarcraft-web:latest + working-directory: ./discord-bot