-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.14 KB
/
ci.yml
File metadata and controls
43 lines (41 loc) · 1.14 KB
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
37
38
39
40
41
42
43
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
env:
IMAGE_NAME: johnhwhite/beanshell
PLATFORMS: "linux/amd64,linux/arm64/v8"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and test
run: |
set -x
docker build -t $IMAGE_NAME .
echo 'print( "hello world" );' | docker run --rm -i $IMAGE_NAME | fgrep 'bsh % hello world'
- uses: docker/setup-qemu-action@v2
with:
platforms: ${{ env.PLATFORMS }}
if: github.ref == 'refs/heads/main'
- uses: docker/setup-buildx-action@v2
with:
platforms: ${{ env.PLATFORMS }}
if: github.ref == 'refs/heads/main'
- uses: docker/login-action@v2
with:
username: johnhwhite
password: ${{ secrets.DOCKER_TOKEN }}
if: github.ref == 'refs/heads/main'
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ env.IMAGE_NAME }}:latest
if: github.ref == 'refs/heads/main'