Add .gitea/workflows/*.yaml
This commit is contained in:
@@ -10,10 +10,10 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
|
|||||||
@@ -10,19 +10,26 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry
|
||||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.cuihang1201.synology.me -u hangpersonal --password-stdin
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_TOKEN }}" | \
|
||||||
|
docker login gitea.cuihang1201.synology.me -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t gitea.cuihang1201.synology.me/hangpersonal/myapp:latest .
|
run: docker build -t gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest .
|
||||||
|
|
||||||
- name: Run Docker image
|
- name: Run Docker image
|
||||||
run: docker run --rm gitea.cuihang1201.synology.me/hangpersonal/myapp:latest
|
run: docker run --rm gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: docker push gitea.cuihang1201.synology.me/hangpersonal/myapp:latest
|
run: docker push gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest
|
||||||
|
|
||||||
|
- name: Clean Docker image on Host
|
||||||
|
run: |
|
||||||
|
docker rmi gitea.cuihang1201.synology.me/hangpersonal/docker_build:latest
|
||||||
|
docker image ls -a
|
||||||
@@ -13,11 +13,11 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
# According to the Gitea documentation, the ubuntu-latest label is mapped
|
# According to the Gitea documentation, the ubuntu-latest label is mapped
|
||||||
# internally to Ubuntu 22.04 environments
|
# internally to Ubuntu 22.04 environments
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
# Pulls your repo into the runner so it has access to the source code
|
# Pulls your repo into the runner so it has access to the source code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build artifact
|
- name: Build artifact
|
||||||
# Makes a directory dist/
|
# Makes a directory dist/
|
||||||
|
|||||||
Reference in New Issue
Block a user