diff options
| author | 2020-02-21 22:22:18 -0800 | |
|---|---|---|
| committer | 2020-02-21 22:40:24 -0800 | |
| commit | 604e80a64e1ded4c002ff5a6ae89ceb329f5a120 (patch) | |
| tree | f6f4698bd3bb3aceedd8cabdc5d742b529e7fba0 /ci | |
| parent | CI: don't build venv image if it can be pulled (diff) | |
CI: merge build job with test job
* Remove duplicate build steps
* Move push steps to a separate YAML file
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/push.yml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ci/push.yml b/ci/push.yml new file mode 100644 index 0000000..9449df0 --- /dev/null +++ b/ci/push.yml @@ -0,0 +1,39 @@ +steps: + # Always build this image unless it's for a pull request. + - script: | + docker build \ + -f docker/Dockerfile \ + -t pythondiscord/snekbox:latest \ + . + displayName: 'Build Final Image' + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + + # Push images only after they've all successfully been built. + - script: docker push pythondiscord/snekbox-base:latest + displayName: 'Push Base Image' + condition: > + and( + succeeded(), + ne(variables['Build.Reason'], 'PullRequest'), + ne(variables.BASE_PULL, 'True'), + or( + eq(variables.BASE_CHANGED, 'True'), + eq(variables.VENV_CHANGED, 'True') + ) + ) + + - script: docker push pythondiscord/snekbox-venv:latest + displayName: 'Push Virtual Environment Image' + condition: > + and( + succeeded(), + ne(variables['Build.Reason'], 'PullRequest'), + or( + eq(variables.BASE_CHANGED, 'True'), + eq(variables.VENV_CHANGED, 'True') + ) + ) + + - script: docker push pythondiscord/snekbox:latest + displayName: 'Push Final Image' + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |