-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.16 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Test Build & Run
on:
pull_request:
permissions:
contents: read
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV
- name: Set up Docker Buildx #must be executed before a step that contains platforms
uses: docker/setup-buildx-action@v2
- name: Build image
uses: elgohr/Publish-Docker-Github-Action@8217e91c0369a5342a4ef2d612de87492410a666 # master
with:
name: flanksource/base-image
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
no_push: true
dockerfile: Dockerfile
tags: 'latest,v${{ env.RELEASE_VERSION }}'
platforms: linux/amd64,linux/arm64
- name: Run the container
run: |
docker run --rm -it flanksource/base-image:v${{ env.RELEASE_VERSION }} exit 0