diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..a8b2e30 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,36 @@ + +name: Build and push Docker image + +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + builder: ${{ steps.buildx.outputs.name }} + context: "{{defaultContext}}:ebs" + file: ./Dockerfile + push: true + platforms: linux/amd64,linux/arm64 + tags: jaedolph/mulletwebhook:${{github.ref_name }},jaedolph/mulletwebhook:latest diff --git a/.github/workflows/run-eslint.yml b/.github/workflows/run-eslint.yml new file mode 100644 index 0000000..bf9ef05 --- /dev/null +++ b/.github/workflows/run-eslint.yml @@ -0,0 +1,15 @@ +name: Run ESLint on javascript + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn + - name: Run ESLint + run: node_modules/eslint/bin/eslint.js frontend/*.js diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..01b326e --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,26 @@ +name: Run tox tests + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.11" + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + - name: Test with tox + run: tox -c ebs/tox.ini diff --git a/.github/workflows/zipfile.build.yml b/.github/workflows/zipfile.build.yml new file mode 100644 index 0000000..e73c121 --- /dev/null +++ b/.github/workflows/zipfile.build.yml @@ -0,0 +1,25 @@ +name: Create zip of frontend files + +on: + release: + types: [published] + +jobs: + zip-files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: download javascript deps + run: | + ./scripts/install_js_deps.sh + shell: bash + - name: create zip file + run: | + ./scripts/package_frontend.sh ${{github.ref_name }} + shell: bash + - name: Upload zip file + run: | + gh release upload ${{github.event.release.tag_name}} dist/mulletwebhook-frontend-${{github.ref_name }}.zip + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + shell: bash