39 lines
1.4 KiB
YAML
Raw Normal View History

2023-03-21 16:11:16 +08:00
name: Gitea Actions Demo
2023-04-12 09:58:49 +08:00
on: [push]
2023-03-21 16:11:16 +08:00
jobs:
2023-03-21 17:09:02 +08:00
Gitea-Actions:
runs-on: ubuntu-latest
2023-03-22 10:00:32 +08:00
container:
image: catthehacker/ubuntu:act-latest
2023-03-23 11:25:15 +08:00
volumes:
- ubuntu_hostedtoolcache:/opt/hostedtoolcache
2023-03-22 10:40:47 +08:00
env:
2023-03-22 10:43:07 +08:00
DOCKER_REGISTRY: registry.cn-hangzhou.aliyuncs.com
DOCKER_USERNAME: rsjst
2023-03-21 16:11:16 +08:00
steps:
2023-03-23 17:25:15 +08:00
- name: Checkout
uses: actions/checkout@v3
- run: cat README.md
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- run: java -version
2023-03-22 11:26:41 +08:00
2023-03-22 10:36:05 +08:00
- name: Get Meta
id: meta
2023-03-22 10:43:07 +08:00
run: |
2023-03-23 11:24:48 +08:00
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION=$(echo ${{ github.ref }} | awk -F"/" '{print $3}' | awk -F"v" '{print $2}') >> $GITHUB_OUTPUT
2023-03-22 10:36:05 +08:00
2023-03-23 11:24:48 +08:00
- run: echo ${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
2023-03-21 16:11:16 +08:00
2023-04-12 09:55:09 +08:00
- name: Notification
2023-04-12 09:43:24 +08:00
if: ${{ secrets.BARK_TOKEN != '' }}
2023-04-12 09:58:21 +08:00
run: curl 'https://api.day.app/${{ secrets.BARK_TOKEN }}/GiteaActions/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} build success.?icon=https://gitea.io/images/gitea.png&group=GiteaActions'
- run: https://api.day.app/${{ secrets.BARK_TOKEN }}/GiteaActions/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} build success.?icon=https://gitea.io/images/gitea.png&group=GiteaActions'