Compare commits
5
Commits
455d82d0f0
...
v0.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3203f024b | ||
|
|
65621ed484 | ||
|
|
29dd4543c3 | ||
|
|
ef416de1a7 | ||
|
|
d16c9aa5bc |
@@ -4,20 +4,13 @@ runs-on: ubuntu-latest
|
|||||||
on: [push]
|
on: [push]
|
||||||
image: python:3.10
|
image: python:3.10
|
||||||
jobs:
|
jobs:
|
||||||
demo:
|
show-gitea-ref:
|
||||||
|
name: Show Gitea.ref
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
- uses: actions/checkout@v3
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
- name: Show
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
run: echo "${{ gitea.ref }}"
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
||||||
- name: List files in the repository
|
|
||||||
run: |
|
|
||||||
ls ${{ gitea.workspace }}
|
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -34,23 +27,24 @@ jobs:
|
|||||||
pip install flake8 mypy pytest
|
pip install flake8 mypy pytest
|
||||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
- name: PEP8 check
|
- name: PEP8 check
|
||||||
run: |
|
run: flake8 ./code --benchmark --exit-zero
|
||||||
flake8 ./code --benchmark --exit-zero
|
|
||||||
- name: Type check
|
- name: Type check
|
||||||
run: |
|
run: mypy ./code
|
||||||
mypy ./code
|
publish:
|
||||||
deploy:
|
name: Publish
|
||||||
name: Deploy
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [test]
|
needs: [test]
|
||||||
if: gitea.ref == 'refs/heads/release'
|
if: gitea.ref == 'refs/heads/release'
|
||||||
|
env:
|
||||||
|
repository_host: 192.168.1.2:5000
|
||||||
|
repository_name: ${{ gitea.repository }}
|
||||||
|
repository_tag: latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build image
|
- name: Build
|
||||||
run: |
|
run: docker build . --file Dockerfile --tag ${repository_name}:${repository_tag}
|
||||||
echo "test message"
|
- name: Tag
|
||||||
echo "below follows gitea.actor:"
|
run: docker tag ${repository_name}:${repository_tag} ${repository_host}/${repository_name}:${repository_tag}
|
||||||
echo "${{ gitea.repository }}"
|
- name: Push
|
||||||
docker build . --file Dockerfile --tag ${{ gitea.repository }}
|
run: docker push ${repository_host}/${repository_name}:${repository_tag}
|
||||||
echo docker images
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user