refactor: env must be applied to the job, not the step
#5
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: Build Docker Images | |
| on: | |
| push: | |
| branches: develop | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| REGISTRY: ghcr.io | |
| OWNER: starfederation | |
| IMAGE_NAME: ${{ github.repository }}-dev | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push Docker Image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./.github | |
| file: ./Dockerfile-dev | |
| target: final | |
| push: true | |
| tags: | | |
| $REGISTRY/$OWNER/$IMAGE_NAME:latest | |
| build-args: | | |
| ENVIRONMENT=development |