fix: consistent oapi time formatting for env created_at #964
This file contains hidden or 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
| name: Apps / Workspace Engine | |
| on: | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - apps/workspace-engine/** | |
| - .github/workflows/apps-workspace-engine.yaml | |
| push: | |
| branches: ["main"] | |
| paths: | |
| - apps/workspace-engine/** | |
| - .github/workflows/apps-workspace-engine.yaml | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| defaults: | |
| run: | |
| working-directory: apps/workspace-engine | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.25" | |
| - name: Cache Go modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Run tests with coverage | |
| run: go test -race ./... | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| strategy: | |
| matrix: | |
| platform: [linux/amd64] | |
| defaults: | |
| run: | |
| working-directory: apps/workspace-engine | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Check if Docker Hub secrets are available | |
| run: | | |
| if [ -z "${{ secrets.DOCKERHUB_USERNAME }}" ] || [ -z "${{ secrets.DOCKERHUB_TOKEN }}" ]; then | |
| echo "DOCKERHUB_LOGIN=false" >> $GITHUB_ENV | |
| else | |
| echo "DOCKERHUB_LOGIN=true" >> $GITHUB_ENV | |
| fi | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| if: env.DOCKERHUB_LOGIN == 'true' | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: ctrlplane/workspace-engine | |
| tags: | | |
| type=sha,format=short,prefix= | |
| - name: Build | |
| uses: docker/build-push-action@v6 | |
| if: github.ref != 'refs/heads/main' | |
| with: | |
| context: apps/workspace-engine | |
| push: false | |
| file: apps/workspace-engine/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| - name: Build and Push | |
| uses: docker/build-push-action@v6 | |
| if: github.ref == 'refs/heads/main' && env.DOCKERHUB_LOGIN == 'true' | |
| with: | |
| context: apps/workspace-engine | |
| push: true | |
| file: apps/workspace-engine/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| tags: ${{ steps.meta.outputs.tags }} |