diff --git a/.gitea/workflows/build-base.yml b/.gitea/workflows/build-base.yml new file mode 100644 index 0000000..4d1f1c5 --- /dev/null +++ b/.gitea/workflows/build-base.yml @@ -0,0 +1,41 @@ +name: Build Base Image + +on: + push: + branches: + - main + paths: + - 'Dockerfile.base' + schedule: + - cron: '@monthly' + workflow_dispatch: + +env: + REGISTRY_URL: ${{ secrets.REGISTRY_URL }} + REGISTRY_IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE_NAME }} + +jobs: + build: + name: Build Base Image + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push base image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.base + push: true + tags: ${{ env.REGISTRY_IMAGE_NAME }}:latest \ No newline at end of file diff --git a/.gitea/workflows/build-cli.yml b/.gitea/workflows/build-cli.yml new file mode 100644 index 0000000..c4af75a --- /dev/null +++ b/.gitea/workflows/build-cli.yml @@ -0,0 +1,44 @@ +name: Build CLI Image + +on: + push: + branches: + - main + paths: + - 'tools/coder-cli/**' + schedule: + - cron: '@monthly' + workflow_dispatch: + +env: + REGISTRY_URL: ${{ secrets.REGISTRY_URL }} + REGISTRY_IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE_NAME }} + +jobs: + build: + name: Build CLI Image + runs-on: ubuntu-latest + concurrency: + group: cli + cancel-in-progress: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push CLI image + uses: docker/build-push-action@v5 + with: + context: . + file: ./tools/coder-cli/Dockerfile + push: true + tags: ${{ env.REGISTRY_IMAGE_NAME }}:cli \ No newline at end of file diff --git a/.gitea/workflows/build-terraform-shell.yml b/.gitea/workflows/build-terraform-shell.yml new file mode 100644 index 0000000..8a97914 --- /dev/null +++ b/.gitea/workflows/build-terraform-shell.yml @@ -0,0 +1,44 @@ +name: Build Terraform Shell Image + +on: + push: + branches: + - main + paths: + - 'tools/terraform-shell/**' + schedule: + - cron: '@monthly' + workflow_dispatch: + +env: + REGISTRY_URL: ${{ secrets.REGISTRY_URL }} + REGISTRY_IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE_NAME }} + +jobs: + build: + name: Build Terraform Shell Image + runs-on: ubuntu-latest + concurrency: + group: terraform + cancel-in-progress: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: ${{ secrets.REGISTRY_URL }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push shell image + uses: docker/build-push-action@v5 + with: + context: . + file: ./tools/terraform-shell/Dockerfile + push: true + tags: ${{ env.REGISTRY_IMAGE_NAME }}:terraform \ No newline at end of file diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index 6b46a51..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Build Docker Images - -on: - push: - branches: - - main - paths: - - 'Dockerfile.base' - - 'tools/coder-cli/**' - - 'tools/terraform-shell/**' - schedule: - - cron: '@daily' # Daily at midnight UTC - workflow_dispatch: - -env: - REGISTRY_URL: ${{ secrets.REGISTRY_URL }} - REGISTRY_IMAGE_NAME: ${{ secrets.REGISTRY_IMAGE_NAME }} - -jobs: - build: - name: Build ${{ matrix.name }} Image - runs-on: ubuntu-latest - concurrency: - group: ${{ matrix.concurrency-group }} - cancel-in-progress: false - strategy: - matrix: - include: - - name: Base - dockerfile: Dockerfile.base - tag: latest - concurrency-group: base - - name: CLI - dockerfile: tools/coder-cli/Dockerfile - tag: cli - concurrency-group: cli - - name: Terraform Shell - dockerfile: tools/terraform-shell/Dockerfile - tag: terraform - concurrency-group: terraform - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to registry - uses: docker/login-action@v3 - with: - registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - - name: Build and push image - uses: docker/build-push-action@v5 - with: - context: . - file: ./${{ matrix.dockerfile }} - push: true - tags: ${{ env.REGISTRY_IMAGE_NAME }}:${{ matrix.tag }}