ovlach_frontend/.gitea/workflows/release_docker.yaml

41 lines
1.6 KiB
YAML

name: release
run-name: release
on:
push:
branches:
- master
jobs:
tests:
name: tests
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout.git@v4
- name: tests
uses: nanobyte-public/rust-action@master
with:
args: |
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
runs-on: ubuntu-latest
needs: [tests] # require tests to pass before deploy runs
container:
image: ovlach/docker-gitea:v0.0.2-alpha
steps:
- uses: https://github.com/actions/checkout.git@v4
- name: Login to git.nanobyte.cz
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DEPLOYMENT_PACKAGE }}
password: ${{ secrets.DEPLOYMENT_PACKAGE }}
registry: git.nanobyte.cz
- name: Get short hash from git repository
id: git
run: echo "::set-output name=short_hash::$(git rev-parse --short HEAD)"
- name: Build and push docker
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}}