Skip to content

Commit 6573bb6

Browse files
committed
Add build on pull request
1 parent 08d2180 commit 6573bb6

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Docker Build
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: read
7+
packages: write
8+
9+
jobs:
10+
build:
11+
name: Docker Build and Push
12+
if: contains(github.event.pull_request.labels.*.name, 'documentation') != true
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
ref: ${{ github.ref }}
19+
clean: true
20+
fetch-depth: 0
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
25+
- name: Login to GitHub Container Registry
26+
uses: docker/login-action@v2
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push
33+
uses: docker/build-push-action@v3
34+
with:
35+
context: docker
36+
push: true
37+
tags: ghcr.io/${{ github.repository }}/vmpooler:pr${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}

0 commit comments

Comments
 (0)