-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (68 loc) · 2.21 KB
/
workflow.yaml
File metadata and controls
72 lines (68 loc) · 2.21 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Java CI
on:
push:
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
version: ${{ steps.project.outputs.version }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots clean install --activate-profiles ui -DskipTests # tests are run in the docker build
- run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v7
with:
name: Package
path: staging
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
image: tonistiigi/binfmt:latest
platforms: arm64,arm
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
- name: Test Docker image
uses: docker/build-push-action@v7
with:
platforms: linux/amd64
# relative path to the place where source code with Dockerfile is located
context: .
target: test
build-args: |
bitwardenEmailFolderId=${{ secrets.BITWARDENEMAILFOLDERID }}
BW_CLIENTID=${{ secrets.BW_CLIENTID }}
BW_CLIENTSECRET=${{ secrets.BW_CLIENTSECRET }}
testItemId=${{ secrets.TESTITEMID }}
testMasterPassword=${{ secrets.TESTMASTERPASSWORD }}
- name: Login to DockerHub
if: github.event_name == 'push'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image and push to Docker Hub
uses: docker/build-push-action@v7
with:
platforms: linux/amd64
context: .
tags: |
stevenmassaro/email:${{ github.sha }}
stevenmassaro/email:${{ github.ref_name }}-${{ github.sha }}
stevenmassaro/email:${{ github.ref_name }}
push: ${{ github.event_name == 'push' }}