diff --git a/.github/workflows/publish-image.yaml b/.github/workflows/publish-image.yaml index d28f0859..668c4be3 100644 --- a/.github/workflows/publish-image.yaml +++ b/.github/workflows/publish-image.yaml @@ -13,8 +13,6 @@ on: required: false env: - IMAGE_REGISTRY: ghcr.io - REGISTRY_USER: $GITHUB_ACTOR API_IMAGE: ghcr.io/equinor/template-fastapi-react/api NGINX_IMAGE: ghcr.io/equinor/template-fastapi-react/nginx @@ -27,7 +25,11 @@ jobs: fetch-depth: 2 - name: "Login to image registry" - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: "Build web" run: | @@ -61,7 +63,11 @@ jobs: fetch-depth: 2 - name: "Login to image registry" - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: "Build API" run: | diff --git a/.github/workflows/rollback.yaml b/.github/workflows/rollback.yaml index 92b74a4b..7eb3cc6d 100644 --- a/.github/workflows/rollback.yaml +++ b/.github/workflows/rollback.yaml @@ -12,10 +12,6 @@ permissions: id-token: write packages: write -env: - IMAGE_REGISTRY: ghcr.io - API_IMAGE: ghcr.io/equinor/neqsimapi - jobs: set-prod-tag: runs-on: ubuntu-latest @@ -29,14 +25,18 @@ jobs: ] steps: - name: "Login to image registry" - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: "Set prod tag on older image" run: | echo "Tagging ${{ matrix.image }}:${{ inputs.release-tag }} with 'production'" docker pull ${{ matrix.image }}:${{ inputs.release-tag }} docker tag ${{ matrix.image }}:${{ inputs.release-tag }} ${{ matrix.image }}:production - docker push $API_IMAGE:production + docker push ${{ matrix.image }}:production # uncomment to apply rollback to radix # deploy: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 310f2dff..7de7f071 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,8 +10,6 @@ on: required: false env: - IMAGE_REGISTRY: ghcr.io - REGISTRY_USER: $GITHUB_ACTOR API_IMAGE: ghcr.io/equinor/template-fastapi-react/api WEB_IMAGE: ghcr.io/equinor/template-fastapi-react/web @@ -22,7 +20,11 @@ jobs: - uses: actions/checkout@v6 - name: Login to image registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build API image run: | @@ -37,7 +39,11 @@ jobs: - uses: actions/checkout@v6 - name: Login to image registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build API image run: | @@ -57,7 +63,11 @@ jobs: - uses: actions/checkout@v6 - name: Login to image registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REGISTRY -u $GITHUB_ACTOR --password-stdin + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build Web Image run: |