diff --git a/.github/workflows/ci-ecr.yml b/.github/workflows/ci-ecr.yml deleted file mode 100644 index 9c98f7e..0000000 --- a/.github/workflows/ci-ecr.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI - -on: - push: - branches: - - master - -permissions: - id-token: write - contents: read - packages: read - - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: Checkout - uses: actions/checkout@v3 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.BUILD_AWS_ACCESS_KEY }} - aws-secret-access-key: ${{ secrets.BUILD_AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.BUILD_AWS_REGION }} - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Build, tag, and push image to Amazon ECR - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: ${{ secrets.BUILD_AWS_REPOSITORY }} - IMAGE_TAG: ${{ github.sha }} - run: | - docker build --build-arg GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ae58d05 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: ci-nullplatform +on: + push: + branches: + - master + - main +permissions: + id-token: write + contents: read + packages: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Start Nullplatform CI + id: setup-ci + uses: nullplatform/github-action-setup-ci@v1 + with: + api-key: ${{ secrets.NULLPLATFORM_API_KEY }} + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Get build parameters + id: get-build-parameters + uses: nullplatform/github-action-parameter@v1 + with: + application-id: ${{ steps.setup-ci.outputs.application-id }} + - name: Build asset for ${{ steps.setup-ci.outputs.application-name }} + id: build-asset + uses: nullplatform/github-action-asset-build@v1 + with: + options: BUILD_ARGS='--build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}' + - name: Push asset for ${{ steps.setup-ci.outputs.application-name }} + id: push-asset + uses: nullplatform/github-action-asset-push@v1 + with: + build-id: ${{ steps.setup-ci.outputs.build-id }} + type: docker-image + - name: End Nullplatform CI + if: ${{ always() }} + id: end-setup-ci + uses: nullplatform/github-action-setup-ci@v1 + with: + build-id: ${{ steps.setup-ci.outputs.build-id }} + status: ${{ contains(fromJSON('["failure", "cancelled"]'), job.status) && 'failed' || 'successful' }}