generated from mrsimonemms/new
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: general updates and housekeeping
- Loading branch information
1 parent
7f5d745
commit f16f239
Showing
12 changed files
with
129 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
branches: | ||
- main | ||
|
@@ -29,40 +14,79 @@ on: | |
permissions: | ||
contents: write | ||
packages: write | ||
pull-requests: read | ||
jobs: | ||
features: | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
commitlint: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: '{{ "${{ secrets.GITHUB_TOKEN }}" }}' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # fetch-depth is required | ||
|
||
- uses: wagoid/commitlint-github-action@v5 | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # fetch-depth is required | ||
|
||
- name: Publish | ||
uses: devcontainers/action@v1 | ||
- name: Set up Go without go.mod | ||
uses: actions/setup-go@v5 | ||
if: ${{ hashFiles('go.mod') == '' }} | ||
with: | ||
publish-features: "true" | ||
base-path-to-features: "./features" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
check-latest: true | ||
|
||
- name: Set up Go with go.mod | ||
uses: actions/setup-go@v5 | ||
if: ${{ hashFiles('go.mod') != '' }} | ||
with: | ||
go-version-file: go.mod | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Setup JS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Install dependencies | ||
run: | | ||
go install ./... || true | ||
npm ci || true | ||
- uses: pre-commit/[email protected] | ||
|
||
base: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- commitlint | ||
- pre-commit | ||
outputs: | ||
docker_registry: ${{ steps.tags.outputs.docker_registry }} | ||
matrix: ${{ steps.tags.outputs.matrix }} | ||
tag: ${{ steps.tags.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup JS | ||
uses: actions/setup-node@v4 | ||
with: | ||
fetch-depth: 0 | ||
node-version: lts/* | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
|
@@ -72,7 +96,7 @@ jobs: | |
id: tags | ||
run: | | ||
echo "docker_registry=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" | ||
echo "matrix={\"img\": $(jq -ncR '[inputs]' <<< $(ls -d images/*))}" >> "$GITHUB_OUTPUT" | ||
echo "matrix={\"img\": $(jq -ncR '[inputs]' <<< $(ls -d images/* | grep -v '/base'))}" >> "$GITHUB_OUTPUT" | ||
echo "tag=$(date --iso-8601)" >> "$GITHUB_OUTPUT" | ||
- name: Install Dev Container CLI | ||
|
@@ -88,39 +112,51 @@ jobs: | |
--platform=linux/amd64 \ | ||
--image-name=${{ steps.tags.outputs.docker_registry }}/base:${{ steps.tags.outputs.tag }} \ | ||
--image-name=${{ steps.tags.outputs.docker_registry }}/base:latest \ | ||
--workspace-folder=base | ||
--workspace-folder=images/base | ||
if [ ${{ github.ref == 'refs/heads/main' }} = "true" ]; then | ||
echo "Pushing images" | ||
docker push ${{ steps.tags.outputs.docker_registry }}/base:${{ steps.tags.outputs.tag }} | ||
docker push ${{ steps.tags.outputs.docker_registry }}/base:latest | ||
else | ||
echo "Saving base image" | ||
docker save ${{ steps.tags.outputs.docker_registry }}/base:latest -o base.tar.gz | ||
fi | ||
- name: Archive Docker image | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
with: | ||
name: docker-image | ||
path: base.tar.gz | ||
if-no-files-found: error | ||
retention-days: 1 | ||
compression-level: 0 | ||
overwrite: true | ||
|
||
images: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- base | ||
strategy: | ||
matrix: ${{ fromJSON(needs.base.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
- name: Setup JS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
|
@@ -136,8 +172,22 @@ jobs: | |
npm install -g @devcontainers/cli | ||
devcontainer --version | ||
- name: Import Docker image | ||
uses: actions/download-artifact@v4 | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
with: | ||
name: docker-image | ||
|
||
- name: Build Dev Container | ||
run: | | ||
if [ ${{ github.ref == 'refs/heads/main' }} = "true" ]; then | ||
echo "Pulling image from registry" | ||
docker pull ${{ needs.base.outputs.docker_registry }}/base | ||
else | ||
echo "Importing image from cache" | ||
docker import base.tar.gz ${{ needs.base.outputs.docker_registry }}/base | ||
fi | ||
docker pull ${{ needs.base.outputs.docker_registry }}/${{ steps.tags.outputs.name }}:latest || true | ||
devcontainer build \ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,4 @@ node_modules | |
.DS_Store | ||
Thumbs.db | ||
.commit | ||
.devbox | ||
.envrc | ||
output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ representative at an online or offline event. | |
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[email protected]. | ||
[[email protected]]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.