name: Docker on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Get the package.json version id: package-version run: echo ::set-output name=version::$(jq -r .version package.json) - name: Build the Docker image run: docker build . --file Dockerfile --tag ghcr.io/sinkaroid/jandapress:${{ steps.package-version.outputs.version }} - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push the Docker image run: docker push ghcr.io/sinkaroid/jandapress:${{ steps.package-version.outputs.version }}