55#
66
77# Name of this project
8- name : example- github-action-composite
8+ name : github-action-docker-image-exists
99
1010# Tags of this project
1111tags :
1212 - github-action
13+ - docker
1314
1415# Logo for this project
1516# logo: docs/logo.png
@@ -18,25 +19,25 @@ tags:
1819license : " APACHE2"
1920
2021# Canonical GitHub repo
21- github_repo : cloudposse/example- github-action-composite
22+ github_repo : cloudposse/github-action-docker-image-exists
2223
2324# Badges to display
2425badges :
2526 - name : " Latest Release"
26- image : " https://img.shields.io/github/release/cloudposse/example- github-action-composite .svg"
27- url : " https://github.com/cloudposse/example- github-action-composite /releases/latest"
27+ image : " https://img.shields.io/github/release/cloudposse/github-action-docker-image-exists .svg"
28+ url : " https://github.com/cloudposse/github-action-docker-image-exists /releases/latest"
2829 - name : " Slack Community"
2930 image : " https://slack.cloudposse.com/badge.svg"
3031 url : " https://slack.cloudposse.com"
3132
32- related : []
33+ related :
34+ - name : " github-action-docker-build-push"
35+ description : " Build Docker image and push it"
36+ url : " https://github.com/cloudposse/github-action-docker-build-push"
3337
34- # Short description of this project
35- description : Template repository of composite GitHub Action
3638
37- introduction : |-
38- This is template repository to create composite GitHub Actions.
39- Feel free to use it as reference and starting point.
39+ # Short description of this project
40+ description : Check if docker image exists by pulling it
4041
4142references :
4243 - name : " github-actions-workflows"
@@ -49,24 +50,31 @@ references:
4950# How to use this project
5051usage : |-
5152 ```yaml
52- name: Pull Request
53+ name: Push into main branch
5354 on:
54- pull_request:
55- branches: [ 'main' ]
56- types: [opened, synchronize, reopened, closed, labeled, unlabeled]
55+ push:
56+ branches: [ master ]
5757
5858 jobs:
5959 context:
6060 runs-on: ubuntu-latest
61- steps:
62- - name: Example action
63- uses: cloudposse/example-github-action-composite@main
64- id: example
61+ continue-on-error: true
62+ steps:
63+ - name: Check image
64+ id: image_exists
65+ uses: cloudposse/github-action-docker-image-exists@main
6566 with:
66- param1: true
67+ registry: registry.hub.docker.com
68+ organization: "${{ github.event.repository.owner.login }}"
69+ repository: "${{ github.event.repository.name }}"
70+ login: "${{ secrets.DOCKERHUB_USERNAME }}"
71+ password: "${{ secrets.DOCKERHUB_PASSWORD }}"
72+ tag: latest
6773
68- outputs:
69- result: ${{ steps.example.outputs.result1 }}
74+ outputs:
75+ result: ${{ steps.image_exists.conclusion }}
76+ image: ${{ steps.image_exists.outputs.image }}
77+ tag: ${{ steps.image_exists.outputs.tag }}
7078 ```
7179
7280include :
0 commit comments