ovlach_frontend/.gitea/workflows/release_docker.yaml

51 lines
1.8 KiB
YAML
Raw Normal View History

2023-12-03 14:46:05 +00:00
name: release
run-name: release
on:
push:
branches:
- master
jobs:
tests:
2023-12-03 18:22:18 +00:00
name: tests
runs-on: ubuntu-latest
steps:
2023-12-09 20:33:53 +00:00
- uses: actions/rust-test@v1
2023-12-03 18:22:18 +00:00
with:
2023-12-09 20:33:53 +00:00
repository: ${{github.repository}}
cargo_nan_secret: ${{secrets.deployment_package}}
2023-12-08 23:56:30 +00:00
docker:
name: docker
2023-12-03 14:46:05 +00:00
runs-on: ubuntu-latest
2023-12-09 20:33:53 +00:00
outputs:
docker_image_version: ${{ steps.docker-image.outputs.image_version }}
2023-12-03 14:46:05 +00:00
container:
image: ovlach/docker-gitea:v0.0.2-alpha
steps:
- uses: https://github.com/actions/checkout.git@v4
2023-12-09 20:33:53 +00:00
- uses: actions/docker-image@b6ee3d56e74e3786309bd59d201133060749954a
id: docker-image
2023-12-03 14:46:05 +00:00
with:
2023-12-09 20:33:53 +00:00
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}}"
2023-12-08 23:56:30 +00:00
stage_deployment:
name: stage-deployment
runs-on: ubuntu-latest
2023-12-09 11:01:41 +00:00
needs: [docker, tests] # require tests to pass before deploy runs
2023-12-09 20:33:53 +00:00
if: ${{ success() }}
2023-12-08 23:56:30 +00:00
steps:
2023-12-09 11:38:19 +00:00
- 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)"
2023-12-09 20:33:53 +00:00
shell: sh
- uses: actions/argo-publish@74b6c94c4303d3f3786d76fb43a205589c08b2a7
2023-12-08 23:56:30 +00:00
with:
2023-12-09 20:33:53 +00:00
argocd_app_repo: 'ovlach/vlach_xyz'
argocd_clone_ssh_key: ${{ secrets.VLACH_XYZ_DEPLOY }}
image: 'git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend'
2023-12-09 21:27:09 +00:00
image_name: 'web'
2023-12-09 20:33:53 +00:00
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'