desc-python bleed #270
This file contains 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: desc-python bleed | |
on: | |
push: | |
branches: | |
- bleed | |
workflow_dispatch: | |
schedule: | |
- cron: '45 20 * * 0' | |
env: | |
TEST_TAG: lsstdesc/desc-python:bleed-dev | |
jobs: | |
build: | |
name: Build on Ubuntu | |
runs-on: ubuntu-22.04 | |
steps: | |
# https://github.com/jlumbroso/free-disk-space/issues/14 | |
- name: Update Package List and Remove Dotnet | |
run: | | |
sudo apt-get update | |
sudo apt-get remove -y '^dotnet-.*' | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
username: heather999 | |
password: '${{ secrets.DOCKERHUB_ACCESSTOK }}' | |
- name: checkout desc-python | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: bleed | |
- name : Get date | |
run: | | |
echo "DATE_TAG=$(date "+%F")" >> $GITHUB_ENV | |
echo $GITHUB_WORKSPACE | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: pull old build | |
run: | | |
docker pull lsstdesc/desc-python:bleed | |
docker tag lsstdesc/desc-python:bleed lsstdesc/desc-python:bleed-old | |
docker push lsstdesc/desc-python:bleed-old | |
- name: Build | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
build-args: | | |
GH_SHA=${{ github.sha }} | |
push: true | |
tags: ${{ env.TEST_TAG }} | |
- name: test image before pushing | |
run: | | |
docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "source /opt/desc/py/etc/profile.d/conda.sh && conda activate base && python -c 'import astropy'" | |
docker tag ${{ env.TEST_TAG }} lsstdesc/desc-python:bleed-${{env.DATE_TAG}} | |
docker push lsstdesc/desc-python:bleed-${{env.DATE_TAG}} | |
docker tag ${{ env.TEST_TAG }} lsstdesc/desc-python:bleed | |
docker push lsstdesc/desc-python:bleed | |