Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jaedolph committed May 27, 2024
1 parent 648a3d0 commit e09377c
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/workflows/run-eslint.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions .github/workflows/zipfile.build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e09377c

Please sign in to comment.