From 62ae88ffdad9ee569a0edecf4afe5908d8c28469 Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sat, 20 Jul 2024 10:50:55 +0100 Subject: [PATCH] adding gitea actions --- .gitea/workflows/test.yml | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..1271a2d --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,70 @@ +name: test and deploy + +on: + push: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + github-server-url: https://gitea.sheep-ghoul.ts.net + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install wasm-pack + uses: jetli/wasm-pack-action@v0.3.0 + + - name: Build Rust for WASM + run: wasm-pack build + + - name: Test WASM in-browser + run: wasm-pack test --firefox --chrome --headless + + - name: Install Node + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Install Node Modules + run: npm ci + working-directory: ./www + + - name: Build Js + run: npm run build --if-present + working-directory: ./www + + package: + + runs-on: ubuntu-latest + needs: [build] # for ignoring bad builds + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + + steps: + - uses: actions/checkout@v4 + with: + github-server-url: https://gitea.sheep-ghoul.ts.net + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + registry: gitea.sheep-ghoul.ts.net + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build & Push Container + uses: docker/build-push-action@v2 + with: + push: true + tags: gitea.sheep-ghoul.ts.net/sarsoo/game-of-life:latest + context: .