feat(npm-tools): update renovate (37.414.1 -> 37.440.6) #299
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
--- | |
# yamllint disable rule:line-length | |
name: "test image" | |
# yamllint disable-line rule:truthy | |
on: | |
pull_request: | |
paths: | |
- 'images/homelab-workspace/**' | |
- '.github/workflows/test-image.yaml' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-workspace-image: | |
uses: ppat/images/.github/workflows/build-image-workflow.yaml@main | |
with: | |
image_context_path: images/homelab-workspace | |
label_title: "Homelab Workspace" | |
label_description: "Homelab workspace image" | |
source_git_ref: ${{ (github.event_name == 'pull_request') && format('refs/heads/{0}', github.head_ref) || github.ref }} | |
timeout_minutes: 120 | |
secrets: | |
private_registry_username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
private_registry_token: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
repository_private_registry: ${{ secrets.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_REGISTRY_PATH }}/homelab-workspace | |
repository_build_cache: ${{ secrets.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_REGISTRY_CACHE_PATH }}/homelab-workspace | |
tailscale_oauth_client_id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }} | |
tailscale_oauth_secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} | |
build_secrets: | | |
FETCH_GH_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
test-image: | |
needs: [build-workspace-image] | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Tailscale Connect | |
uses: tailscale/github-action@4e4c49acaa9818630ce0bd7a564372c17e33fb4d # v2 | |
with: | |
oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TAILSCALE_OAUTH_SECRET }} | |
tags: tag:github-action-ci-runner | |
# renovate: datasource=github-releases depName=tailscale/tailscale | |
version: "1.70.0" | |
- name: Login to container registry | |
id: login | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: ${{ secrets.CONTAINER_REGISTRY }} | |
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} | |
- name: Test image | |
id: test | |
env: | |
container_image: "${{ secrets.CONTAINER_REGISTRY }}/${{ vars.CONTAINER_REGISTRY_PATH }}/homelab-workspace:${{ needs.build-workspace-image.outputs.image_tag }}" | |
container_name: "test_${{ github.run_id }}" | |
test_user: tester | |
shell: bash | |
run: | | |
echo "Fetch built image from registry" | |
docker pull $container_image | |
echo | |
echo "Show available images..." | |
docker images | |
echo | |
echo "Starting container $container_name using image $container_image..." | |
docker run -it -d --name $container_name --user 0:0 --entrypoint /bin/bash $container_image | |
echo "Done" | |
echo | |
echo "Show running container..." | |
docker ps -f name=$container_name | |
echo "Done" | |
echo | |
echo "Create test user within container..." | |
docker exec $container_name sudo -u root useradd --groups sudo --shell /bin/bash --home-dir /home/$test_user --create-home $test_user | |
echo "Done" | |
echo | |
echo "Running agent-startup script..." | |
docker exec $container_name sudo -u $test_user /bin/bash --noprofile --norc /opt/coder/bin/agent-startup.sh | |
echo "Done" | |
echo | |
- name: Tailscale Disconnect | |
if: success() || failure() | |
run: sudo -E tailscale logout |