name: Overseerr CI on: pull_request: branches: - '*' push: branches: - develop jobs: test: runs-on: ubuntu-18.04 container: node:12.18-alpine steps: - name: checkout uses: actions/checkout@v2 - name: install dependencies env: HUSKY_SKIP_INSTALL: 1 run: yarn - name: lint run: yarn lint - name: build run: yarn build build_and_push: name: Build and push Docker image to Docker Hub needs: test if: github.ref == 'refs/heads/develop' && !contains(github.event.head_commit.message, 'skip ci') runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - name: Build and push uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile push: true build-args: | COMMIT_TAG=${{ github.sha }} tags: | sctx/overseerr:develop sctx/overseerr:${{ github.sha }} ghcr.io/sct/overseerr:develop ghcr.io/sct/overseerr:${{ github.sha }}