浏览代码

stayactive test

crocandr 2 年之前
父节点
当前提交
7fa2d8fa41
共有 1 个文件被更改,包括 22 次插入19 次删除
  1. 22 19
      .github/workflows/main.yml

+ 22 - 19
.github/workflows/main.yml

@@ -19,7 +19,28 @@ on:
 
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
-  # This workflow contains a single job called "build"
+  stayactive:
+    runs-on: ubuntu-latest
+    steps:
+      - name: clone-update-push-delete
+        env:
+          PRIVKEY: ${{ secrets.PRIVKEY }}
+        run: |
+          echo "$PRIVKEY" > $GITHUB_WORKSPACE/customkey
+          chmod 600 $GITHUB_WORKSPACE/customkey
+          GIT_SSH_COMMAND="ssh -i $GITHUB_WORKSPACE/customkey"
+          cat $GITHUB_WORKSPACE/customkey | base64
+          echo "Github repo: $GITHUB_REPOSITORY"
+          git clone [email protected]:$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE/stay || { echo "git clone error"; exit 1; }
+          cd $GITHUB_WORKSPACE/stay || { echo "folder change problem"; exit 1; }
+          git branch stayactive
+          git checkout stayactive
+          date >> status.txt
+          git config user.name $GITHUB_REPOSITORY_OWNER
+          git config user.email automation@dummy
+          git commit -m "stay active"
+          git push origin stayactive:stayactive || { echo "Stayactive branch push error"; exit 1; }
+          git push origin -d stayactive || { echo "Stayactive branch delete error"; exit 1; }
   build-amd64:
     # The type of runner that the job will run on
     runs-on: ubuntu-latest
@@ -115,22 +136,4 @@ jobs:
           # build and push
           #docker run --rm -v $PWD:/workspace gcr.io/kaniko-project/executor --context /workspace --customPlatform linux/arm64/v8 --no-push || { echo "Build error"; exit 1; }
           docker run --rm -v $PWD:/workspace -v $PWD/config.json:/kaniko/.docker/config.json:ro gcr.io/kaniko-project/executor --context /workspace --customPlatform linux/arm64/v8 --destination=croc/softether-arm64:$SOFTETHER_VERSION --destination=croc/softether-arm64:latest || { echo "Build and push error"; exit 1; }
-      - name: stay active
-        env:
-          PRIVKEY: ${{ secrets.PRIVKEY }}
-        run: |
-          echo "$PRIVKEY" > customkey
-          chmod 600 customkey
-          GIT_SSH_COMMAND="ssh -i customkey"
-          cat customkey | base64
-          git clone [email protected]:$GITHUB_REPOSITORY.git stay || { echo "git clone error"; exit 1; }
-          cd stay || { echo "folder change problem"; exit 1; }
-          git branch stayactive
-          git checkout stayactive
-          date >> status.txt
-          git config user.name $GITHUB_REPOSITORY_OWNER
-          git config user.email automation@dummy
-          git commit -m "stay active"
-          git push origin stayactive:stayactive || { echo "Stayactive branch push error"; exit 1; }
-          git push origin -d stayactive || { echo "Stayactive branch delete error"; exit 1; }