Skip to content

Support simple auth #39

Support simple auth

Support simple auth #39

Workflow file for this run

name: ci
on:
push:
branches:
- main
paths:
- tsunagu-server/**
- tsunagu-client/**
- pom.xml
- .github/workflows/ci.yaml
pull_request:
branches:
- main
paths:
- tsunagu-server/**
- tsunagu-client/**
- pom.xml
- .github/workflows/ci.yaml
jobs:
build:
strategy:
matrix:
component: [ server, client ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: graalvm/setup-graalvm@v1
with:
version: '22.1.0'
java-version: '11'
components: 'native-image'
- name: build-native-image
run: |
set -ex
cd ${GITHUB_WORKSPACE}/tsunagu-${{ matrix.component }}
./mvnw clean package --no-transfer-progress -DskipTests -V -Pnative,mostly-static
unzip target/*.zip -d ../dist
rm -f ../dist/Procfile
mv ../dist/am* ../dist/tsunagu-${{ matrix.component }}-linux-x86_64
- id: setup-pack
if: github.ref == 'refs/heads/main'
uses: buildpacks/github-actions/[email protected]
- name: build-container-image
if: github.ref == 'refs/heads/main'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
mkdir -p ~/.docker
cat <<EOF > ~/.docker/config.json
{"auths":{"ghcr.io":{"username":"${DOCKER_USERNAME}","password":"${DOCKER_PASSWORD}"}}}
EOF
set -x
pack build ghcr.io/${DOCKER_USERNAME}/tsunagu-${{ matrix.component }} -p ${GITHUB_WORKSPACE}/tsunagu-${{ matrix.component }}/target/*.zip --builder paketobuildpacks/builder:tiny --publish
- uses: actions/upload-artifact@v2
with:
name: tsunagu-dist
path: dist/*