From 3139c4c9b95287c73240923aedc4405d5b2db7ba Mon Sep 17 00:00:00 2001 From: itt828 Date: Sun, 18 Dec 2022 08:50:40 +0900 Subject: [PATCH 1/3] :construction_worker: add push-to-gitea.yml --- .github/workflows/push-to-gitea.yml | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/push-to-gitea.yml diff --git a/.github/workflows/push-to-gitea.yml b/.github/workflows/push-to-gitea.yml new file mode 100644 index 0000000..74d1254 --- /dev/null +++ b/.github/workflows/push-to-gitea.yml @@ -0,0 +1,87 @@ +## gitea に同期する用の actions +name: main + +on: + push: + branches: + - "main" + +env: + GITEA_SSH_URL: "ssh://git@git.trap.jp:2200/hackathon-22-winter-01/front-end.git" + NODE_VERSION: "19" + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: set node version + uses: actions/setup-node@v3 + with: + node-version: ${{env.NODE_VERSION}} + cache: yarn + - name: lint + uses: rome/setup-rome@v0.4 + with: + version: latest + run: rome check . + format: + name: format + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: set node version + uses: actions/setup-node@v3 + with: + node-version: ${{env.NODE_VERSION}} + cache: yarn + - name: format + uses: rome/setup-rome@v0.4 + with: + version: latest + run: rome format . + build: + name: build + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: set node version + uses: actions/setup-node@v3 + with: + node-version: ${{env.NODE_VERSION}} + cache: yarn + - name: install + run: yarn --check-files --frozen-lockfile --non-interactive + - name: build + run: yarn build + sync: + name: sync + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: restore cache + uses: actions + with: + path: .output + key: build-${{github.sha}} + - name: set config + run: | + echo "${{ secrets.GITEA_TOKEN }}" > ~/deploy_key.pem + chmod 600 ~/deploy_key.pem + git config --local user.email "github@actions" + git config --local user.name "github" + - name: commit (include build) + run: | + git add .output -f + git commit -m "[build] ${{ github.event.head_commit.id }}" + - name: Push changes + env: + GIT_SSH_COMMAND: ssh -i ~/deploy_key.pem -o StrictHostKeyChecking=no -F /dev/null + run: | + git fetch --unshallow origin + git push -f ${{ env.GITEA_SSH_URL }} main:master From 79607e12461d1740d223668fe239e0dd67a3e12b Mon Sep 17 00:00:00 2001 From: itt828 Date: Sun, 18 Dec 2022 09:00:58 +0900 Subject: [PATCH 2/3] :construction_worker: add showcase.yaml --- showcase.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 showcase.yaml diff --git a/showcase.yaml b/showcase.yaml new file mode 100644 index 0000000..8dbcf0e --- /dev/null +++ b/showcase.yaml @@ -0,0 +1,7 @@ +type: runtime + +work_dir: ./output +entrypoint: yarn start +http_proxy: 8080 + +https: "on" From 6b1947b7b677df495719739a9684a5687f0447c6 Mon Sep 17 00:00:00 2001 From: itt828 Date: Sun, 18 Dec 2022 16:13:30 +0900 Subject: [PATCH 3/3] :bug: fix --- .github/workflows/push-to-gitea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-to-gitea.yml b/.github/workflows/push-to-gitea.yml index 74d1254..8938037 100644 --- a/.github/workflows/push-to-gitea.yml +++ b/.github/workflows/push-to-gitea.yml @@ -65,7 +65,7 @@ jobs: - name: checkout uses: actions/checkout@v3 - name: restore cache - uses: actions + uses: actions/cache@v3 with: path: .output key: build-${{github.sha}}