feat: release docker images

This commit is contained in:
Ondrej Vlach 2023-12-09 00:56:30 +01:00
parent e6032a2039
commit f7a1685fa2
Signed by: ovlach
GPG Key ID: 4FF1A23B4914DE70

View File

@ -17,8 +17,8 @@ jobs:
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" cargo clippy -- -Dwarnings && \
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" cargo clippy --tests -- -Dwarnings && \
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" cargo test
deploy:
name: deploy
docker:
name: docker
runs-on: ubuntu-latest
needs: [tests] # require tests to pass before deploy runs
container:
@ -38,3 +38,20 @@ jobs:
run: |
docker build . -t git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend:${{steps.git.outputs.short_hash}} --build-arg GITEA_TOKEN="Bearer ${{secrets.DEPLOYMENT_PACKAGE}}" && \
docker push git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend:${{steps.git.outputs.short_hash}}
stage_deployment:
name: stage-deployment
runs-on: ubuntu-latest
needs: [docker] # require tests to pass before deploy runs
steps:
- name: Install kustomize
run: |
apt-get update && apt-get install -y curl && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
- uses: https://github.com/actions/checkout.git@v4
with:
ssh: '${{ secrets.VLACH_XYZ_DEPLOY }}'
path: 'vlach_xyz_deploy'
repository: 'git@git.nanobyte.cz:ovlach/vlach_xyz.git'
ref: 'master'
- name: Update images
run: |
cd vlach_xyz_deploy && kustomize edit set image web=git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_frontend:${{steps.git.outputs.short_hash}} && git add . && git commit -m "upgrade ovlach_frontend -> ${{steps.git.outputs.short_hash}}" && git push origin master