Update main.yml #2
Workflow file for this run
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: Test sharing images among jobs | |
# Controls when the action will run. Triggers the workflow on push request, or repository dispatch | |
on: | |
# Runs when pushing to 'stable' branch | |
push: | |
# branches: | |
# - 'stable' | |
# - 'test' | |
branches-ignore: | |
- 'master' | |
tags: | |
- '*' | |
# Run in every PR too | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build image | |
run: | | |
docker pull continuumio/miniconda3 | |
docker tag continuumio/miniconda3 someimage:xyz | |
- name: Save image | |
run: | | |
docker save --output /tmp/image.tar someimage:xyz | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: myimage | |
path: /tmp/image.tar | |
use: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: myimage | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/image.tar | |
docker image ls -a |