Skip to content

Commit

Permalink
Merge pull request #9 from yfukai/ci
Browse files Browse the repository at this point in the history
Ci
  • Loading branch information
yfukai authored Jan 30, 2024
2 parents 8948fdf + aae36b8 commit c2be4c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 58 deletions.
56 changes: 5 additions & 51 deletions .github/workflows/delete-docker-on-pr-close.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker
name: Docker delete tags

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
Expand Down Expand Up @@ -53,80 +53,34 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata (JAX conda CPU)
id: meta_jax_conda
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.JAX_CONDA_IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
- name: Extract Docker metadata (JAX conda GPU)
id: meta_jax_conda_cuda
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.JAX_CONDA_IMAGE_NAME }}
tags: |
type=schedule,suffix=-cuda
type=ref,event=branch,suffix=-cuda
type=ref,event=tag,suffix=-cuda
type=ref,event=pr,suffix=-cuda
- name: Extract Docker metadata (CPU)
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
- name: Extract Docker metadata (GPU)
id: meta_cuda
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule,suffix=-cuda
type=ref,event=branch,suffix=-cuda
type=ref,event=tag,suffix=-cuda
type=ref,event=pr,suffix=-cuda
- name: Delete image (JAX conda CPU)
uses: bots-house/[email protected]
with:
owner: yfukai
name: ${{ env.JAX_CONDA_IMAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.meta_jax_conda.outputs.tags }}
tag: pr-${{github.event.pull_request.number }}

- name: Delete image (JAX conda GPU)
uses: bots-house/[email protected]
with:
owner: yfukai
name: ${{ env.JAX_CONDA_IMAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.meta_jax_conda_cuda.outputs.tags }}
tag: pr-${{github.event.pull_request.number }}-cuda

- name: Delete image (JAX conda CPU)
uses: bots-house/[email protected]
with:
owner: yfukai
name: ${{ env.IMAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.meta.outputs.tags }}
tag: pr-${{github.event.pull_request.number }}

- name: Delete image (JAX conda GPU)
uses: bots-house/[email protected]
with:
owner: yfukai
name: ${{ env.IMAGE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.meta_cuda.outputs.tags }}
tag: pr-${{github.event.pull_request.number }}-cuda
16 changes: 9 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker
name: Docker Publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
Expand Down Expand Up @@ -70,10 +70,11 @@ jobs:
- name: Extract first tag (JAX conda CPU)
id: extract_first_tag_cpu
run: |
# Extracting the first component
first_component=$(echo "${{ steps.meta_jax_conda.outputs.tags }}" | cut -d ',' -f 1)
# Extracting the first tag
tags="${{ steps.meta_jax_conda.outputs.tags }}"
first_line=$(echo "$tags" | head -n 1)
# Setting the output
echo "meta_jax_conda_first_tag=$first_component" >> $GITHUB_OUTPUT
echo "meta_jax_conda_first_tag=$first_line" >> $GITHUB_OUTPUT
- name: Extract Docker metadata (JAX conda GPU)
id: meta_jax_conda_cuda
Expand All @@ -89,10 +90,11 @@ jobs:
- name: Extract first tag (JAX conda GPU)
id: extract_first_tag_gpu
run: |
# Extracting the first component
first_component=$(echo "${{ steps.meta_jax_conda_cuda.outputs.tags }}" | cut -d ',' -f 1)
# Extracting the first tag
tags="${{ steps.meta_jax_conda_cuda.outputs.tags }}"
first_line=$(echo "$tags" | head -n 1)
# Setting the output
echo "meta_jax_conda_cuda_first_tag=$first_component" >> $GITHUB_OUTPUT
echo "meta_jax_conda_cuda_first_tag=$first_line" >> $GITHUB_OUTPUT
- name: Extract Docker metadata (CPU)
id: meta
Expand Down

0 comments on commit c2be4c0

Please sign in to comment.