diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7620767 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +name: Linting +on: [pull_request] + +jobs: + lint: + if: "!contains(github.event.pull_request.title, 'WIP!')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install Dependencies + run: npm ci + - name: Run Eslint + run: npm run lint diff --git a/.github/workflows/pretty.yml b/.github/workflows/pretty.yml new file mode 100644 index 0000000..ca4475f --- /dev/null +++ b/.github/workflows/pretty.yml @@ -0,0 +1,17 @@ +name: Prettier +on: [pull_request] + +jobs: + pretty: + if: "!contains(github.event.pull_request.title, 'WIP!')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install Dependencies + run: npm ci + - name: Run Prettier + run: npm run pretty diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 0000000..a96d04e --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,41 @@ +name: Publish docker image + +on: + release: + types: [released] + +jobs: + push_to_registry: + name: Push Docker Image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.HUB_DOCKER_USERNAME }} + password: ${{ secrets.HUB_DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: eyevinntechnology/shaka-packager-s3 + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b444083 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + - run: | + npm install + npm run build + npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml new file mode 100644 index 0000000..9ca981d --- /dev/null +++ b/.github/workflows/typescript.yml @@ -0,0 +1,17 @@ +name: Type Check +on: [pull_request] + +jobs: + ts: + if: "!contains(github.event.pull_request.title, 'WIP!')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install Dependencies + run: npm ci + - name: Run Type Check + run: npm run typecheck