diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index e49fa2d..81138a9 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -6,7 +6,6 @@ on: push: branches: - main - - 'static-docs' permissions: contents: read diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..bd859e9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,47 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Free up disk space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: true + swap-storage: false + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Dockerfile + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/Dockerfile + load: true + push: false + tags: quay.io/microbiome-informatics/emg-notebooks.dev:latest + + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Push + run: | + docker tag quay.io/microbiome-informatics/emg-notebooks.dev:latest quay.io/microbiome-informatics/emg-notebooks.dev:${{ github.ref_name }} + docker push quay.io/microbiome-informatics/emg-notebooks.dev:${{ github.ref_name }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d786784..9c77a32 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -41,14 +41,15 @@ jobs: run: npm install - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build Dockerfile - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . file: ./docker/Dockerfile load: true + push: false tags: quay.io/microbiome-informatics/emg-notebooks.dev:latest - name: Run tests @@ -62,4 +63,21 @@ jobs: path: | tests/launching_jl.png tests/shiny_proxy_launched.png - tests/jl_launched.png \ No newline at end of file + tests/jl_launched.png + + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Push + run: | + docker tag quay.io/microbiome-informatics/emg-notebooks.dev:latest quay.io/microbiome-informatics/emg-notebooks.dev:${{ github.ref_name }} + docker push quay.io/microbiome-informatics/emg-notebooks.dev:${{ github.ref_name }} + + - name: Push latest + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + run: | + docker push quay.io/microbiome-informatics/emg-notebooks.dev:latest