From d14088817eb60e23a4dfaa5e7d36d9d52ed25fc4 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 12 Sep 2023 12:42:10 -0400 Subject: [PATCH 1/4] rootless/ful docker images build seperately vendor go modules outside docker to speed up build --- .github/workflows/release-nightly.yml | 30 ++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index ca01ccfaa769e..eb3e11e71e35f 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -51,7 +51,7 @@ jobs: AWS_REGION: ${{ secrets.AWS_REGION }} SOURCE_DIR: dist/release DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }} - nightly-docker: + nightly-docker-rootful: runs-on: actuated-4cpu-8gb steps: - uses: actions/checkout@v3 @@ -75,6 +75,8 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: fetch go modules + run: make vendor - name: build rootful docker image uses: docker/build-push-action@v4 with: @@ -82,6 +84,32 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: gitea/gitea:${{ steps.clean_name.outputs.branch }} + nightly-docker-rootless: + runs-on: actuated-4cpu-8gb + steps: + - uses: actions/checkout@v3 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 + - name: Get cleaned branch name + id: clean_name + run: | + # if main then say nightly otherwise cleanup name + if [ "${{ github.ref }}" = "refs/heads/main" ]; then + echo "branch=nightly" >> "$GITHUB_OUTPUT" + exit 0 + fi + REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') + echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT" + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: fetch go modules + run: make vendor - name: build rootless docker image uses: docker/build-push-action@v4 with: From a63a3bf9247161dae3a7dcffbc3e0ad90d6b395b Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 12 Sep 2023 12:47:08 -0400 Subject: [PATCH 2/4] cancel in progress on new merge --- .github/workflows/release-nightly.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index eb3e11e71e35f..68a49a5940748 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -4,6 +4,10 @@ on: push: branches: [ main, release/v* ] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: nightly-binary: runs-on: actuated-4cpu-8gb From 69e5b4b3e7ba091b8e32f9f6ffc19f5a19d0d624 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 12 Sep 2023 12:52:36 -0400 Subject: [PATCH 3/4] fix lint --- .github/workflows/release-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index 68a49a5940748..f8b4033308e59 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -113,7 +113,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: fetch go modules - run: make vendor + run: make vendor - name: build rootless docker image uses: docker/build-push-action@v4 with: From 23431bb3139986c2c593e34c65a01f6c36ab1321 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 12 Sep 2023 13:01:42 -0400 Subject: [PATCH 4/4] add self hosted runners to list --- .github/actionlint.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/actionlint.yaml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000000000..24c80bc60a7de --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,4 @@ +self-hosted-runner: + labels: + - actuated-4cpu-8gb + - actuated-4cpu-16gb