Revert node version bump #157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker | |
| on: | |
| push: | |
| # Publish `master` as Docker `latest` image. | |
| branches: | |
| - master | |
| - dev | |
| # Publish `v1.2.3` tags as releases. | |
| tags: | |
| - v* | |
| # Run tests for any PRs. | |
| pull_request: | |
| env: | |
| # TODO: Change variable to your image's name. | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: servermanager | |
| jobs: | |
| # Run tests. | |
| # See also https://docs.docker.com/docker-hub/builds/automated-testing/ | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Run tests | |
| run: | | |
| if [ -f docker-compose.test.yml ]; then | |
| docker-compose --file docker-compose.test.yml build | |
| docker-compose --file docker-compose.test.yml run sut | |
| else | |
| docker build . --file Dockerfile | |
| fi | |
| # Push image to GitHub Packages. | |
| # See also https://docs.docker.com/docker-hub/builds/ | |
| push: | |
| # Ensure test job passes before pushing image. | |
| needs: test | |
| name: Build and publish image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| type=ref,event=pr | |
| type=sha,format=long | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | |
| - name: Log in to GitHub Container Registry | |
| if: github.event_name == 'push' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && github.ref == 'refs/heads/master' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |