|
1 | | -# Create release files |
2 | 1 | name: Release |
3 | 2 |
|
4 | 3 | on: |
5 | 4 | release: |
6 | 5 | types: [ published ] |
7 | 6 |
|
8 | 7 | env: |
9 | | - DOCKER_IMAGE: radarbase/radar-redcapintegration |
| 8 | + REGISTRY: ghcr.io |
| 9 | + REPOSITORY: ${{ github.repository }} |
| 10 | + IMAGE_NAME: radar-redcapintegration |
10 | 11 |
|
11 | 12 | jobs: |
12 | | - # Build and push tagged release docker image |
13 | 13 | docker: |
14 | | - # The type of runner that the job will run on |
15 | 14 | runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + packages: write |
16 | 18 |
|
17 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
18 | 19 | steps: |
19 | | - - uses: actions/checkout@v3 |
| 20 | + - uses: actions/checkout@v5 |
20 | 21 |
|
21 | | - # Add Docker labels and tags |
22 | | - - name: Docker meta |
23 | | - id: docker_meta |
24 | | - uses: docker/metadata-action@v4 |
25 | | - with: |
26 | | - images: ${{ env.DOCKER_IMAGE }} |
27 | | - tags: | |
28 | | - type=semver,pattern={{version}} |
29 | | - type=semver,pattern={{major}}.{{minor}} |
30 | | -
|
31 | | - - name: Login to DockerHub |
| 22 | + - name: Login to Container Registry |
32 | 23 | uses: docker/login-action@v2 |
33 | 24 | with: |
34 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
35 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 25 | + registry: ${{ env.REGISTRY }} |
| 26 | + username: ${{ github.actor }} |
| 27 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + |
| 29 | + - name: Lowercase image name |
| 30 | + run: | |
| 31 | + echo "DOCKER_IMAGE=${REGISTRY}/${REPOSITORY,,}/${IMAGE_NAME}" >>${GITHUB_ENV} |
36 | 32 |
|
37 | 33 | - name: Build and push |
38 | 34 | id: docker_build |
39 | | - uses: docker/build-push-action@v3 |
| 35 | + uses: docker/build-push-action@v6 |
40 | 36 | with: |
41 | | - # Allow running the image on the architectures supported by openjdk:11-jre-slim |
| 37 | + # Allow running the image on the architectures supported by openjdk:17-jre-slim |
42 | 38 | push: true |
43 | 39 | tags: ${{ steps.docker_meta.outputs.tags }} |
44 | 40 | context: . |
|
0 commit comments