diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml new file mode 100644 index 0000000..0b17147 --- /dev/null +++ b/.github/workflows/devcontainer.yml @@ -0,0 +1,30 @@ +name: Publish devcontainer stuff + +on: + push: + branches: + - "main" + paths: + - "devcontainer/**" + - ".github/workflows/devcontainer.yml" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Log into Registry + uses: docker/login-action@v2 + with: + registry: ${{ vars.REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Publish features + uses: devcontainers/action@v1 + with: + publish-features: "true" + base-path-to-features: "./devcontainer/feature" + oci-registry: ${{ vars.REGISTRY }} diff --git a/devcontainer/feature/sqlx/devcontainer-feature.json b/devcontainer/feature/sqlx/devcontainer-feature.json new file mode 100644 index 0000000..33ed14f --- /dev/null +++ b/devcontainer/feature/sqlx/devcontainer-feature.json @@ -0,0 +1,7 @@ +{ + "id": "sqlx", + "version": "0.1.0", + "name": "SQLx", + "description": "Add the SQLx-cli", + "documentationURL": "https://github.com/launchbadge/sqlx" +} diff --git a/devcontainer/feature/sqlx/install.sh b/devcontainer/feature/sqlx/install.sh new file mode 100755 index 0000000..bb9534e --- /dev/null +++ b/devcontainer/feature/sqlx/install.sh @@ -0,0 +1,4 @@ +curl -sOL https://github.com/cargo-bins/cargo-quickinstall/releases/download/sqlx-cli-0.7.3-x86_64-unknown-linux-gnu/sqlx-cli-0.7.3-x86_64-unknown-linux-gnu.tar.gz +tar -xzf sqlx-cli-0.7.3-x86_64-unknown-linux-gnu.tar.gz +cp sqlx /usr/local/bin/ +rm sqlx cargo-sqlx sqlx-cli-0.6.3-x86_64-unknown-linux-gnu.tar.gz