64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: Build on push
|
|
run-name: Build on push
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-api:
|
|
runs-on: [runner]
|
|
container: git.sh-edraft.de/sh-edraft/act-runner:latest
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: https://github.com/actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Build docker
|
|
run: |
|
|
docker build -t git.sh-edraft.de/sh-edraft/open-redirect-api:$(cat version.txt) .
|
|
|
|
- name: Login to registry git.sh-edraft.de
|
|
uses: https://github.com/docker/login-action@v1
|
|
with:
|
|
registry: git.sh-edraft.de
|
|
username: ${{ secrets.CI_USERNAME }}
|
|
password: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push git.sh-edraft.de/sh-edraft/open-redirect-api:$(cat version.txt)
|
|
|
|
build-web:
|
|
runs-on: [runner]
|
|
container: git.sh-edraft.de/sh-edraft/act-runner:latest
|
|
steps:
|
|
- name: Clone Repository
|
|
uses: https://github.com/actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Prepare web build
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Build web
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Build docker
|
|
run: |
|
|
docker build -t git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt) .
|
|
|
|
- name: Login to registry git.sh-edraft.de
|
|
uses: https://github.com/docker/login-action@v1
|
|
with:
|
|
registry: git.sh-edraft.de
|
|
username: ${{ secrets.CI_USERNAME }}
|
|
password: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt)
|