Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
Build test container on PR (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbampalikis authored Feb 15, 2023
2 parents 910882a + 6df44fe commit a45e947
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build_pr_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: build PR container
on:
pull_request:
paths:
- '*.go'
- './Dockerfile'

jobs:
build:
name: Build PR image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to the Github Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build container
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:PR${{ github.event.number }}
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.revision=${{ github.sha }}

0 comments on commit a45e947

Please sign in to comment.