Create github action to build docker image #1
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 and publish docker image | |
| on: | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| - uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ secrets.USER_NAME }} # username | |
| password: ${{ secrets.CR_PAT }} # PAT for CR repository | |
| - name: Build Docker Image | |
| run: docker build . --file Dockerfile --tag ghcr.io/intelligent-testing-lab/autoware-scenario-runner:$(date +%s) | |
| - name: Push Docker Image | |
| run: docker push ghcr.io/intelligent-testing-lab/autoware-scenario-runner:$(date +%s) |