Amna | f981c70 | 2024-06-03 10:24:18 -0400 | [diff] [blame] | 1 | name: Release Package |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | env: |
| 8 | REGISTRY: ghcr.io |
| 9 | IMAGE_NAME_DEPS: ${{ github.repository }}/dhtnet |
| 10 | |
| 11 | jobs: |
| 12 | build: |
| 13 | runs-on: ubuntu-latest |
| 14 | name: DHTNet Docker image |
| 15 | permissions: |
| 16 | contents: read |
| 17 | packages: write |
| 18 | |
| 19 | steps: |
| 20 | - name: Checkout repository |
| 21 | uses: actions/checkout@v4 |
| 22 | |
| 23 | - name: Log in to the Container registry |
| 24 | uses: docker/login-action@v3 |
| 25 | with: |
| 26 | registry: ${{ env.REGISTRY }} |
| 27 | username: ${{ github.actor }} |
| 28 | password: ${{ secrets.GITHUB_TOKEN }} |
| 29 | |
| 30 | - name: Extract metadata (tags, labels) for Docker |
| 31 | id: meta |
| 32 | uses: docker/metadata-action@v5 |
| 33 | with: |
| 34 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_DEPS }} |
| 35 | |
| 36 | - name: Build and push Docker image |
Amna | ad02d56 | 2024-07-02 13:08:44 -0400 | [diff] [blame] | 37 | uses: docker/build-push-action@v6 |
Amna | f981c70 | 2024-06-03 10:24:18 -0400 | [diff] [blame] | 38 | with: |
| 39 | context: . |
| 40 | file: ./Dockerfile |
| 41 | push: true |
| 42 | tags: ${{ steps.meta.outputs.tags }} |
Amna | ad02d56 | 2024-07-02 13:08:44 -0400 | [diff] [blame] | 43 | labels: ${{ steps.meta.outputs.labels }} |
| 44 | target: build |