Skip to content
This repository was archived by the owner on Jun 11, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ubient/laravel-vapor-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.2
Choose a base ref
...
head repository: ubient/laravel-vapor-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 14 commits
  • 7 files changed
  • 3 contributors

Commits on Nov 19, 2019

  1. Copy the full SHA
    4cae55b View commit details

Commits on Dec 10, 2019

  1. pin base image to 1.9.0 (#5)

    This fixes an issue when building the dockerfile:
    
    ```
    configure: error: Package requirements (oniguruma) were not met:
    
    Package 'oniguruma', required by 'virtual:world', not found
    ```
    sambernard authored and claudiodekker committed Dec 10, 2019
    Copy the full SHA
    f66f03d View commit details

Commits on Apr 5, 2020

  1. Version 1.1.0 (#11)

    Fixes #9
    claudiodekker authored Apr 5, 2020
    Copy the full SHA
    e6d7225 View commit details
  2. Add more images to the Readme (#12)

    Co-authored-by: Claudio Dekker <claudiodekker@users.noreply.github.com>
    claudiodekker and claudiodekker authored Apr 5, 2020
    Copy the full SHA
    26e323b View commit details

Commits on Apr 29, 2020

  1. Copy the full SHA
    4b433bf View commit details
  2. Add Dockerfile Caching

    Fixes #7
    claudiodekker authored Apr 29, 2020
    Copy the full SHA
    4fc8f12 View commit details
  3. Copy the full SHA
    55b81e8 View commit details

Commits on Jun 15, 2020

  1. Fixed PHP 7.4 support due to missing oniguruma library (required by P…

    …HP mbstring) (#16)
    
    * Update Dockerfile
    
    * Update CHANGELOG.md
    claudiodekker authored Jun 15, 2020
    Copy the full SHA
    d06b689 View commit details

Commits on Sep 7, 2020

  1. Create FUNDING.yml

    claudiodekker authored Sep 7, 2020
    Copy the full SHA
    751f827 View commit details
  2. Update FUNDING.yml

    claudiodekker authored Sep 7, 2020
    Copy the full SHA
    fa44b1c View commit details

Commits on May 12, 2021

  1. Copy the full SHA
    dd7f9ff View commit details
  2. Copy the full SHA
    f32abc5 View commit details
  3. Update README.md

    claudiodekker committed May 12, 2021
    Copy the full SHA
    0bcdb81 View commit details

Commits on Jun 11, 2021

  1. Add deprecation notice (#21)

    * Delete FUNDING.yml
    
    * Update README.md
    claudiodekker authored Jun 11, 2021
    Copy the full SHA
    f306dd7 View commit details
Showing with 129 additions and 49 deletions.
  1. +75 −0 .github/workflows/docker-publish.yml
  2. +11 −0 CHANGELOG.md
  3. +3 −10 Dockerfile
  4. +30 −39 README.md
  5. +9 −0 action.yml
  6. BIN images/project-settings-secrets.png
  7. +1 −0 vapor-entrypoint
75 changes: 75 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Based on https://github.com/actions/starter-workflows/blob/master/ci/docker-publish.yml

name: Docker

on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master

# Publish tags as releases.
tags:
- "**"

# Run tests for any PRs.
pull_request:

env:
# TODO: Change variable to your image's name.
IMAGE_NAME: laravel-vapor-action

jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test

runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile --tag image

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,3 +4,14 @@ All notable changes to `ubient/laravel-vapor-action` will be documented in this

## 1.0.0 - 2019-09-25
- Initial release

## 1.1.0 - 2020-04-05
- New and improved approach (that supersedes this Action in a way) thanks to [@kurucu](https://github.com/kurucu).
- Updated [README.md](README.md)

## 1.2.0 - 2020-04-29
- Added automatic Docker Image building, tagging & publishing.
- Added Docker Image method (allowing for the most performant build times so far!)

## 1.2.1 - 2020-06-15
- Fixed PHP 7.4 support due to missing oniguruma library (required by PHP mbstring)
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
FROM composer:latest
FROM composer:2.0

LABEL repository="https://github.com/ubient/laravel-vapor-action"
LABEL homepage="https://github.com/ubient/laravel-vapor-action"
LABEL maintainer="Claudio Dekker <claudio@ubient.net>"

LABEL com.github.actions.name="Laravel Vapor"
LABEL com.github.actions.description="Run Laravel Vapor commands directly from Github Actions"
LABEL com.github.actions.icon="upload-cloud"
LABEL com.github.actions.color="blue"

# Install required extenstions for laravel
# Install required extenstions for laravel
# https://laravel.com/docs/6.x#server-requirements
RUN apk add libxml2-dev && \
RUN apk add oniguruma-dev libxml2-dev && \
docker-php-ext-install bcmath xml tokenizer mbstring

# Install Vapor + Prestissimo (parallel/quicker composer install)
RUN set -xe && \
composer global require hirak/prestissimo && \
composer global require laravel/vapor-cli && \
composer clear-cache

69 changes: 30 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Laravel Vapor Action

[![Latest Version](https://img.shields.io/github/release/ubient/laravel-vapor-action.svg?style=flat-square)](https://github.com/ubient/laravel-vapor-action/releases)

This Github Action provides a way to directly use Laravel Vapor from within your CI pipeline.
# Laravel Vapor Action

This Github Action is no longer maintained, and has been removed from the Github Marketplace.

## Requirements
While this package will remain available/installable for the forseeable future, **this package WILL NOT be receiving any further (security) updates going forward**. Instead, you are recommended to use the significantly faster and more flexible approach as documented below:

First and foremost, you will need to have Github Actions enabled for the account you're planning to use this action on.
If you are not yet part of the beta, you can [sign up here](https://github.com/features/actions/signup/).
![image](https://user-images.githubusercontent.com/1752195/121706739-33743d00-cad6-11eb-9885-95c32c472082.png)

Furthermore, you will need an active [Laravel Vapor](https://vapor.laravel.com) subscription.
## Replacement / recommended alternative approach

## Usage
Please note that you will need an active [Laravel Vapor](https://vapor.laravel.com) subscription.

### Setting up a Github Secret
In order to authenticate with Vapor from Github Actions, we will need to add a `VAPOR_API_TOKEN` [secret](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) to your repository.
### 1. Setting up a Github Secret
In order to authenticate with Vapor from Github Actions, we will need to add a `VAPOR_API_TOKEN` [secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets) to your repository.\
To do so, you may do the following:
1. On GitHub, navigate to the main page of the repository you intend to use this action on.
2. Under your repository name, click `Settings`.
@@ -23,54 +22,46 @@ To do so, you may do the following:
5. For the name of your secret, enter `VAPOR_API_TOKEN`.
6. For the value itself, enter your Laravel Vapor API token. You may generate one in your [Vapor API settings dashboard](https://vapor.laravel.com/app/account/api-tokens).
7. Click `Add secret`.
![Example of the Project Settings Secrets page](/images/project-settings-secrets.png)

### Setting up our Github Action
Next, let's head over to the `Actions` page, and create a new workflow.
### 2. Setting up your Github Action

Next, let's head over to the `Actions` page, and create a new workflow.\
To keep things simple, let's set up an action that deploys to production as soon as a branch is merged into master:

```yaml
name: Deploy to production

on:
push:
branches:
- master
branches: [ master ]

jobs:
vapor:
name: Deploy to production
name: Check out, build and deploy using Vapor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ubient/laravel-vapor-action@master
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer:v2
coverage: none
- name: Require Vapor CLI
run: composer global require laravel/vapor-cli
- name: Deploy Environment
run: vapor deploy
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
with:
args: "deploy production"
```
> **Note**: To find out more regarding this syntax, you can take a look at [this page](https://help.github.com/en/articles/workflow-syntax-for-github-actions#onevent_nametypes).
#### Explanation
The above does a few things:
1. It does a git checkout out your Laravel App (your repository) using the `actions/checkout` action.
2. It builds the `ubient/laravel-vapor-action@master` image (using this repository's Dockerfile).
3. It runs the built container, passing in the Vapor API token previously configured in your repository's Github Secrets.
4. It executes the `vapor` CLI command, passing in the arguments given. In our example, this means it runs `vapor deploy production`.

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email claudio@ubient.net instead of using the issue tracker.

## License
2. It prepares your PHP environment using the amazing [shivammathur/setup-php](https://github.com/shivammathur/setup-php).
3. It installs the [Laravel Vapor CLI](https://docs.vapor.build/1.0/introduction.html#installing-the-vapor-cli) using Composer.
5. It executes the `vapor` CLI command using [the `deploy` argument](https://docs.vapor.build/1.0/projects/deployments.html#initiating-deployments).

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
If you would like to find out more regarding the syntax used by Github Actions, you can take a look at [this page](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#onevent_nametypes).
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Laravel Vapor'
description: 'Run Laravel Vapor commands directly from Github Actions'
author: 'Claudio Dekker <claudio@ubient.net>'
branding:
icon: 'upload-cloud'
color: 'blue'
runs:
using: 'docker'
image: 'Dockerfile'
Binary file added images/project-settings-secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions vapor-entrypoint
Original file line number Diff line number Diff line change
@@ -8,5 +8,6 @@ if [ -z ${VAPOR_API_TOKEN} ]; then
exit 1
fi

composer global require laravel/vapor-cli --no-interaction --prefer-dist --quiet
php $COMPOSER_HOME/vendor/bin/vapor "$@" -vvv
exit $?