wip
This commit is contained in:
31
.gitea/workflows/release_docker.yaml
Normal file
31
.gitea/workflows/release_docker.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
name: release
|
||||
run-name: release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
tests:
|
||||
uses: ./.gitea/workflows/test.yaml # use the callable tests job to run tests
|
||||
secrets: inherit
|
||||
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_backend:${{steps.git.outputs.short_hash}} --build-arg GITEA_TOKEN="Bearer ${{secrets.DEPLOYMENT_PACKAGE}}" && \
|
||||
docker push git.nanobyte.cz/$GITHUB_REPOSITORY_OWNER/ovlach_backend:${{steps.git.outputs.short_hash}}
|
||||
@@ -2,52 +2,66 @@ name: test
|
||||
run-name: test
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
DEPLOYMENT_PACKAGE:
|
||||
description: 'needed for checkout depenediencies'
|
||||
required: true
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
jobs:
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: git.nanobyte.cz/nanobyte/nano-rust-builder:1.74.5f84654
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout.git@v4
|
||||
- name: Hash of Cargo.lock
|
||||
id: get-hash
|
||||
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; }')"
|
||||
- uses: https://gitea.com/wolfogre/cache/restore@v3
|
||||
id: cache
|
||||
with:
|
||||
key: "${{github.repository}}-cache-cargo-clippy-v4-${{ steps.get-hash.outputs.hash }}"
|
||||
path: |
|
||||
.cache
|
||||
target
|
||||
key: ${{github.repository}}-cache-cargo-clippy-v4-${{ hashFiles('Cargo.lock') }}
|
||||
restore-keys: ${{github.repository}}-cache-cargo-clippy-v4
|
||||
- uses: nanobyte-public/rust-action@master
|
||||
with:
|
||||
args: CARGO_HOME=./.cache cargo clippy -- -Dwarnings
|
||||
args: CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.DEPLOYMENT_PACKAGE}}\" cargo clippy -- -Dwarnings
|
||||
- uses: https://gitea.com/wolfogre/cache/save@v3
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: |
|
||||
.cache
|
||||
target
|
||||
key: ${{github.repository}}-cache-cargo-clippy-v4-${{ hashFiles('Cargo.lock') }}
|
||||
key: "${{github.repository}}-cache-cargo-clippy-v4-${{ steps.get-hash.outputs.hash }}"
|
||||
test:
|
||||
container:
|
||||
image: git.nanobyte.cz/nanobyte/nano-rust-builder:1.74.5f84654
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout.git@v4
|
||||
- name: Hash of Cargo.lock
|
||||
id: get-hash
|
||||
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; '})"
|
||||
- uses: https://gitea.com/wolfogre/cache/restore@v3
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
.cache
|
||||
target
|
||||
key: ${{github.repository}}-cache-cargo-test-v4-${{ hashFiles('Cargo.lock') }}
|
||||
restore-keys: ${{github.repository}}-cache-cargo-test-v4
|
||||
key: "${{github.repository}}-cache-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"
|
||||
restore-keys: ${{github.repository}}-cache-test-test-v4
|
||||
- uses: nanobyte-public/rust-action@master
|
||||
with:
|
||||
args: |
|
||||
CARGO_HOME=./.cache cargo test
|
||||
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.DEPLOYMENT_PACKAGE}}\" cargo test
|
||||
- uses: https://gitea.com/wolfogre/cache/save@v3
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
path: |
|
||||
.cache
|
||||
target
|
||||
key: ${{github.repository}}-cache-cargo-test-v4-${{ hashFiles('Cargo.lock') }}
|
||||
key: "${{github.repository}}-cache-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"
|
||||
|
||||
Reference in New Issue
Block a user