forked from jitsi/jicofo
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 2.47 KB
/
maven-dev.yml
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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Maven DEV deploy
on:
workflow_dispatch:
inputs:
xmpp-extensions-version:
description: 'jitsi-xmpp-extensions library version (1.0-18-gee3ce37)'
required: true
default: '1.0-18-gee3ce37'
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/nic/env/dev'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set output vars
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Set pom version
run: |
mvn versions:set -DnewVersion=1.1-${{ steps.vars.outputs.sha_short }}
mvn versions:commit
- name: Update settings.xml
uses: whelk-io/maven-settings-xml-action@v14
with:
repositories: '[{ "id": "github", "url": "https://maven.pkg.github.com/nordeck/jicofo" }]'
servers: '[{ "id": "github", "username": "${{ github.repository_owner }}", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Deploy with Maven
run: mvn deploy -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/nordeck/jicofo -Djitsi.xmpp.extensions.version=${{ github.event.inputs.xmpp-extensions-version }}
- name: Download package
run: |
curl -u ${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }} -o ./jicofo.zip -L https://maven.pkg.github.com/nordeck/jicofo/org/jitsi/jicofo/1.1-${{ steps.vars.outputs.sha_short }}/jicofo-1.1-${{ steps.vars.outputs.sha_short }}-archive.zip
7z x ./jicofo.zip -o./tmp -r
mv ./tmp/jicofo-1.1-${{ steps.vars.outputs.sha_short }} ./tmp/jicofo
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Deploy Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.sha_short }}