51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
name: release
|
|
run-name: release
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
jobs:
|
|
tests:
|
|
name: tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/rust-test@v1
|
|
with:
|
|
repository: ${{github.repository}}
|
|
cargo_nan_secret: ${{secrets.deployment_package}}
|
|
docker:
|
|
name: docker
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
docker_image_version: ${{ steps.docker-image.outputs.image_version }}
|
|
container:
|
|
image: ovlach/docker-gitea:v0.0.2-alpha
|
|
steps:
|
|
- uses: https://github.com/actions/checkout.git@v4
|
|
- uses: actions/docker-image@b6ee3d56e74e3786309bd59d201133060749954a
|
|
id: docker-image
|
|
with:
|
|
deployment_login: ${{ secrets.DEPLOYMENT_PACKAGE }}
|
|
registry: 'git.nanobyte.cz'
|
|
image_name: git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend
|
|
aditional_args: --build-arg GITEA_TOKEN="${{secrets.DEPLOYMENT_PACKAGE}}"
|
|
stage_deployment:
|
|
name: stage-deployment
|
|
runs-on: ubuntu-latest
|
|
needs: [docker, tests] # require tests to pass before deploy runs
|
|
if: ${{ success() }}
|
|
steps:
|
|
- uses: https://github.com/actions/checkout.git@v4
|
|
- name: Get short hash from git repository
|
|
id: git
|
|
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
|
|
shell: sh
|
|
- uses: actions/argo-publish@74b6c94c4303d3f3786d76fb43a205589c08b2a7
|
|
with:
|
|
argocd_app_repo: 'ovlach/vlach_xyz'
|
|
argocd_clone_ssh_key: ${{ secrets.VLACH_XYZ_DEPLOY }}
|
|
image: 'git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend'
|
|
image_name: 'web'
|
|
image_version: '${{ steps.git.outputs.short_hash }}' # ${{ needs.docker.outputs.docker_image_version }} - not work due to https://gitea.com/gitea/act_runner/issues/358
|
|
environment: 'staging'
|