Migrate docker image hosting from docker.pkg.github.com to ghcr.io #2640
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: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24.18.0 | |
| - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - run: npm install | |
| - run: npm run lint | |
| - run: npm run test | |
| - id: docker_meta | |
| uses: crazy-max/ghaction-docker-meta@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 | |
| with: | |
| images: ghcr.io/appvia/githubusermanager | |
| flavor: | | |
| latest=true | |
| tags: | | |
| type=sha | |
| type=semver,pattern=v{{version}} | |
| labels: | | |
| org.opencontainers.image.vendor=appvia | |
| org.opencontainers.image.documentation=https://github.com/appvia/githubUserManager | |
| org.opencontainers.image.authors=Chris Nesbitt-Smith <chris.nesbitt-smith@appvia.io> | |
| maintainer=appvia | |
| - name: Login to docker registry | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push to ghcr.io | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | |
| with: | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.docker_meta.outputs.tags }} | |
| labels: ${{ steps.docker_meta.outputs.labels }} |